summaryrefslogtreecommitdiff
path: root/patches/wownero/0010-build-wownero-seed.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/wownero/0010-build-wownero-seed.patch')
-rw-r--r--patches/wownero/0010-build-wownero-seed.patch155
1 files changed, 77 insertions, 78 deletions
diff --git a/patches/wownero/0010-build-wownero-seed.patch b/patches/wownero/0010-build-wownero-seed.patch
index 99c94b5..a393697 100644
--- a/patches/wownero/0010-build-wownero-seed.patch
+++ b/patches/wownero/0010-build-wownero-seed.patch
@@ -1,7 +1,7 @@
-From ffa7b0f65d40e941c05940e70fe278493c48d594 Mon Sep 17 00:00:00 2001
+From 6c94fb26ef4d87ceb53cdcf9fb372bc3420e9db9 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Thu, 25 Apr 2024 10:06:04 +0200
-Subject: [PATCH] build wownero-seed
+Subject: [PATCH 10/14] build wownero-seed
---
contrib/depends/hosts/android.mk | 3 +-
@@ -9,8 +9,8 @@ Subject: [PATCH] build wownero-seed
contrib/depends/hosts/mingw32.mk | 3 +
contrib/depends/packages/packages.mk | 2 +-
contrib/depends/packages/wownero_seed.mk | 35 ++
- .../0001-fix-duplicate-symbol-error.patch | 498 ++++++++++++++++++
- 6 files changed, 540 insertions(+), 2 deletions(-)
+ .../0001-fix-duplicate-symbol-error.patch | 497 ++++++++++++++++++
+ 6 files changed, 539 insertions(+), 2 deletions(-)
create mode 100644 contrib/depends/packages/wownero_seed.mk
create mode 100644 contrib/depends/patches/wownero_seed/0001-fix-duplicate-symbol-error.patch
@@ -107,10 +107,10 @@ index 000000000..b376f80c5
+endef
diff --git a/contrib/depends/patches/wownero_seed/0001-fix-duplicate-symbol-error.patch b/contrib/depends/patches/wownero_seed/0001-fix-duplicate-symbol-error.patch
new file mode 100644
-index 000000000..1969f3f23
+index 000000000..a8f8fe059
--- /dev/null
+++ b/contrib/depends/patches/wownero_seed/0001-fix-duplicate-symbol-error.patch
-@@ -0,0 +1,498 @@
+@@ -0,0 +1,497 @@
+From 4be93209afb80b11834a0849391ee6eeb68aec4a Mon Sep 17 00:00:00 2001
+From: Czarek Nakamoto <cyjan@mrcyjanek.net>
+Date: Thu, 25 Apr 2024 09:37:37 +0200
@@ -131,36 +131,36 @@ index 000000000..1969f3f23
+--- a/src/argon2/argon2.c
++++ b/src/argon2/argon2.c
+@@ -37,7 +37,7 @@ const char *argon2_type2string(argon2_type type, int uppercase) {
-+
++
+ int argon2_ctx(argon2_context *context, argon2_type type) {
+ /* 1. Validate all inputs */
+- int result = validate_inputs(context);
++ int result = validate_inputs_wowseed(context);
+ uint32_t memory_blocks, segment_length;
+ argon2_instance_t instance;
-+
++
+@@ -78,20 +78,20 @@ int argon2_ctx(argon2_context *context, argon2_type type) {
+ /* 3. Initialization: Hashing inputs, allocating memory, filling first
+ * blocks
+ */
+- result = initialize(&instance, context);
++ result = initialize_wowseed(&instance, context);
-+
++
+ if (ARGON2_OK != result) {
+ return result;
+ }
-+
++
+ /* 4. Filling memory */
+- result = fill_memory_blocks(&instance);
++ result = _fill_memory_blocks_wowseed(&instance);
-+
++
+ if (ARGON2_OK != result) {
+ return result;
+ }
+ /* 5. Finalization */
+- finalize(context, &instance);
++ finalize_wowseed(context, &instance);
-+
++
+ return ARGON2_OK;
+ }
+diff --git a/src/argon2/argon2.h b/src/argon2/argon2.h
@@ -177,7 +177,7 @@ index 000000000..1969f3f23
+ */
+ typedef struct Argon2_Context {
+@@ -329,7 +329,7 @@ ARGON2_PUBLIC int argon2_hash(const uint32_t t_cost, const uint32_t m_cost,
-+
++
+ /**
+ * Verifies a password against an encoded string
+- * Encoded string is restricted as in validate_inputs()
@@ -191,7 +191,7 @@ index 000000000..1969f3f23
++++ b/src/argon2/blake2/blake2.h
+@@ -67,15 +67,15 @@ enum {
+ };
-+
++
+ /* Streaming API */
+-ARGON2_LOCAL int blake2b_init(blake2b_state *S, size_t outlen);
+-ARGON2_LOCAL int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key,
@@ -204,12 +204,12 @@ index 000000000..1969f3f23
++ARGON2_LOCAL int blake2b_init_param_wowseed(blake2b_state *S, const blake2b_param *P);
++ARGON2_LOCAL int blake2b_update_wowseed(blake2b_state *S, const void *in, size_t inlen);
++ARGON2_LOCAL int blake2b_final_wowseed(blake2b_state *S, void *out, size_t outlen);
-+
++
+ /* Simple API */
+-ARGON2_LOCAL int blake2b(void *out, size_t outlen, const void *in, size_t inlen,
++ARGON2_LOCAL int blake2b_wowseed(void *out, size_t outlen, const void *in, size_t inlen,
+ const void *key, size_t keylen);
-+
++
+ /* Argon2 Team - Begin Code */
+diff --git a/src/argon2/blake2/blake2b.c b/src/argon2/blake2/blake2b.c
+index ca05df5..8138b86 100644
@@ -218,38 +218,38 @@ index 000000000..1969f3f23
+@@ -70,7 +70,7 @@ static BLAKE2_INLINE void blake2b_init0(blake2b_state *S) {
+ memcpy(S->h, blake2b_IV, sizeof(S->h));
+ }
-+
++
+-int blake2b_init_param(blake2b_state *S, const blake2b_param *P) {
++int blake2b_init_param_wowseed(blake2b_state *S, const blake2b_param *P) {
+ const unsigned char *p = (const unsigned char *)P;
+ unsigned int i;
-+
++
+@@ -88,7 +88,7 @@ int blake2b_init_param(blake2b_state *S, const blake2b_param *P) {
+ }
-+
++
+ /* Sequential blake2b initialization */
+-int blake2b_init(blake2b_state *S, size_t outlen) {
++int blake2b_init_wowseed(blake2b_state *S, size_t outlen) {
+ blake2b_param P;
-+
++
+ if (S == NULL) {
+@@ -113,10 +113,10 @@ int blake2b_init(blake2b_state *S, size_t outlen) {
+ memset(P.salt, 0, sizeof(P.salt));
+ memset(P.personal, 0, sizeof(P.personal));
-+
++
+- return blake2b_init_param(S, &P);
++ return blake2b_init_param_wowseed(S, &P);
+ }
-+
++
+-int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key,
++int blake2b_init_key_wowseed(blake2b_state *S, size_t outlen, const void *key,
+ size_t keylen) {
+ blake2b_param P;
-+
++
+@@ -147,7 +147,7 @@ int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key,
+ memset(P.salt, 0, sizeof(P.salt));
+ memset(P.personal, 0, sizeof(P.personal));
-+
++
+- if (blake2b_init_param(S, &P) < 0) {
++ if (blake2b_init_param_wowseed(S, &P) < 0) {
+ blake2b_invalidate_state(S);
@@ -267,25 +267,25 @@ index 000000000..1969f3f23
+@@ -221,7 +221,7 @@ static void blake2b_compress(blake2b_state *S, const uint8_t *block) {
+ #undef ROUND
+ }
-+
++
+-int blake2b_update(blake2b_state *S, const void *in, size_t inlen) {
++int blake2b_update_wowseed(blake2b_state *S, const void *in, size_t inlen) {
+ const uint8_t *pin = (const uint8_t *)in;
-+
++
+ if (inlen == 0) {
+@@ -261,7 +261,7 @@ int blake2b_update(blake2b_state *S, const void *in, size_t inlen) {
+ return 0;
+ }
-+
++
+-int blake2b_final(blake2b_state *S, void *out, size_t outlen) {
++int blake2b_final_wowseed(blake2b_state *S, void *out, size_t outlen) {
+ uint8_t buffer[BLAKE2B_OUTBYTES] = {0};
+ unsigned int i;
-+
++
+@@ -291,7 +291,7 @@ int blake2b_final(blake2b_state *S, void *out, size_t outlen) {
+ return 0;
+ }
-+
++
+-int blake2b(void *out, size_t outlen, const void *in, size_t inlen,
++int blake2b_wowseed(void *out, size_t outlen, const void *in, size_t inlen,
+ const void *key, size_t keylen) {
@@ -293,7 +293,7 @@ index 000000000..1969f3f23
+ int ret = -1;
+@@ -310,19 +310,19 @@ int blake2b(void *out, size_t outlen, const void *in, size_t inlen,
+ }
-+
++
+ if (keylen > 0) {
+- if (blake2b_init_key(&S, outlen, key, keylen) < 0) {
++ if (blake2b_init_key_wowseed(&S, outlen, key, keylen) < 0) {
@@ -305,19 +305,19 @@ index 000000000..1969f3f23
+ goto fail;
+ }
+ }
-+
++
+- if (blake2b_update(&S, in, inlen) < 0) {
++ if (blake2b_update_wowseed(&S, in, inlen) < 0) {
+ goto fail;
+ }
+- ret = blake2b_final(&S, out, outlen);
++ ret = blake2b_final_wowseed(&S, out, outlen);
-+
++
+ fail:
+ clear_internal_memory(&S, sizeof(S));
+@@ -352,25 +352,25 @@ int blake2b_long(void *pout, size_t outlen, const void *in, size_t inlen) {
+ } while ((void)0, 0)
-+
++
+ if (outlen <= BLAKE2B_OUTBYTES) {
+- TRY(blake2b_init(&blake_state, outlen));
+- TRY(blake2b_update(&blake_state, outlen_bytes, sizeof(outlen_bytes)));
@@ -342,7 +342,7 @@ index 000000000..1969f3f23
+ memcpy(out, out_buffer, BLAKE2B_OUTBYTES / 2);
+ out += BLAKE2B_OUTBYTES / 2;
+ toproduce = (uint32_t)outlen - BLAKE2B_OUTBYTES / 2;
-+
++
+ while (toproduce > BLAKE2B_OUTBYTES) {
+ memcpy(in_buffer, out_buffer, BLAKE2B_OUTBYTES);
+- TRY(blake2b(out_buffer, BLAKE2B_OUTBYTES, in_buffer,
@@ -352,7 +352,7 @@ index 000000000..1969f3f23
+ out += BLAKE2B_OUTBYTES / 2;
+@@ -378,7 +378,7 @@ int blake2b_long(void *pout, size_t outlen, const void *in, size_t inlen) {
+ }
-+
++
+ memcpy(in_buffer, out_buffer, BLAKE2B_OUTBYTES);
+- TRY(blake2b(out_buffer, toproduce, in_buffer, BLAKE2B_OUTBYTES, NULL,
++ TRY(blake2b_wowseed(out_buffer, toproduce, in_buffer, BLAKE2B_OUTBYTES, NULL,
@@ -366,7 +366,7 @@ index 000000000..1969f3f23
+@@ -151,7 +151,7 @@ void clear_internal_memory(void *v, size_t n) {
+ }
+ }
-+
++
+-void finalize(const argon2_context *context, argon2_instance_t *instance) {
++void finalize_wowseed(const argon2_context *context, argon2_instance_t *instance) {
+ if (context != NULL && instance != NULL) {
@@ -374,26 +374,26 @@ index 000000000..1969f3f23
+ uint32_t l;
+@@ -256,7 +256,7 @@ uint32_t index_alpha(const argon2_instance_t *instance,
+ }
-+
++
+ /* Single-threaded version for p=1 case */
+-static int fill_memory_blocks_st(argon2_instance_t *instance) {
++static int _fill_memory_blocks_wowseed_st(argon2_instance_t *instance) {
+ uint32_t r, s, l;
-+
++
+ for (r = 0; r < instance->passes; ++r) {
+@@ -273,14 +273,14 @@ static int fill_memory_blocks_st(argon2_instance_t *instance) {
+ return ARGON2_OK;
+ }
-+
++
+-int fill_memory_blocks(argon2_instance_t *instance) {
++int _fill_memory_blocks_wowseed(argon2_instance_t *instance) {
-+ if (instance == NULL || instance->lanes == 0) {
-+ return ARGON2_INCORRECT_PARAMETER;
++ if (instance == NULL || instance->lanes == 0) {
++ return ARGON2_INCORRECT_PARAMETER;
+ }
+- return fill_memory_blocks_st(instance);
++ return _fill_memory_blocks_wowseed_st(instance);
+ }
-+
++
+-int validate_inputs(const argon2_context *context) {
++int validate_inputs_wowseed(const argon2_context *context) {
+ if (NULL == context) {
@@ -402,7 +402,7 @@ index 000000000..1969f3f23
+@@ -407,7 +407,7 @@ int validate_inputs(const argon2_context *context) {
+ return ARGON2_OK;
+ }
-+
++
+-void fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instance) {
++void fill_first_blocks_wowseed(uint8_t *blockhash, const argon2_instance_t *instance) {
+ uint32_t l;
@@ -411,7 +411,7 @@ index 000000000..1969f3f23
+@@ -430,7 +430,7 @@ void fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instance) {
+ clear_internal_memory(blockhash_bytes, ARGON2_BLOCK_SIZE);
+ }
-+
++
+-void initial_hash(uint8_t *blockhash, argon2_context *context,
++void initial_hash_wowseed(uint8_t *blockhash, argon2_context *context,
+ argon2_type type) {
@@ -420,89 +420,89 @@ index 000000000..1969f3f23
+@@ -439,31 +439,31 @@ void initial_hash(uint8_t *blockhash, argon2_context *context,
+ return;
+ }
-+
++
+- blake2b_init(&BlakeHash, ARGON2_PREHASH_DIGEST_LENGTH);
++ blake2b_init_wowseed(&BlakeHash, ARGON2_PREHASH_DIGEST_LENGTH);
-+
++
+ store32(&value, context->lanes);
+- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)&value, sizeof(value));
-+
++
+ store32(&value, context->outlen);
+- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)&value, sizeof(value));
-+
++
+ store32(&value, context->m_cost);
+- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)&value, sizeof(value));
-+
++
+ store32(&value, context->t_cost);
+- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)&value, sizeof(value));
-+
++
+ store32(&value, context->version);
+- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)&value, sizeof(value));
-+
++
+ store32(&value, (uint32_t)type);
+- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)&value, sizeof(value));
-+
++
+ store32(&value, context->pwdlen);
+- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)&value, sizeof(value));
-+
++
+ if (context->pwd != NULL) {
+- blake2b_update(&BlakeHash, (const uint8_t *)context->pwd,
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)context->pwd,
+ context->pwdlen);
-+
++
+ if (context->flags & ARGON2_FLAG_CLEAR_PASSWORD) {
+@@ -473,18 +473,18 @@ void initial_hash(uint8_t *blockhash, argon2_context *context,
+ }
-+
++
+ store32(&value, context->saltlen);
+- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)&value, sizeof(value));
-+
++
+ if (context->salt != NULL) {
+- blake2b_update(&BlakeHash, (const uint8_t *)context->salt,
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)context->salt,
+ context->saltlen);
+ }
-+
++
+ store32(&value, context->secretlen);
+- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)&value, sizeof(value));
-+
++
+ if (context->secret != NULL) {
+- blake2b_update(&BlakeHash, (const uint8_t *)context->secret,
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)context->secret,
+ context->secretlen);
-+
++
+ if (context->flags & ARGON2_FLAG_CLEAR_SECRET) {
+@@ -494,17 +494,17 @@ void initial_hash(uint8_t *blockhash, argon2_context *context,
+ }
-+
++
+ store32(&value, context->adlen);
+- blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)&value, sizeof(value));
-+
++
+ if (context->ad != NULL) {
+- blake2b_update(&BlakeHash, (const uint8_t *)context->ad,
++ blake2b_update_wowseed(&BlakeHash, (const uint8_t *)context->ad,
+ context->adlen);
+ }
-+
++
+- blake2b_final(&BlakeHash, blockhash, ARGON2_PREHASH_DIGEST_LENGTH);
++ blake2b_final_wowseed(&BlakeHash, blockhash, ARGON2_PREHASH_DIGEST_LENGTH);
+ }
-+
++
+-int initialize(argon2_instance_t *instance, argon2_context *context) {
++int initialize_wowseed(argon2_instance_t *instance, argon2_context *context) {
+ uint8_t blockhash[ARGON2_PREHASH_SEED_LENGTH];
+ int result = ARGON2_OK;
-+
++
+@@ -523,7 +523,7 @@ int initialize(argon2_instance_t *instance, argon2_context *context) {
+ /* H_0 + 8 extra bytes to produce the first blocks */
+ /* uint8_t blockhash[ARGON2_PREHASH_SEED_LENGTH]; */
@@ -513,26 +513,26 @@ index 000000000..1969f3f23
+ clear_internal_memory(blockhash + ARGON2_PREHASH_DIGEST_LENGTH,
+ ARGON2_PREHASH_SEED_LENGTH -
+@@ -535,7 +535,7 @@ int initialize(argon2_instance_t *instance, argon2_context *context) {
-+
++
+ /* 3. Creating first blocks, we always have at least two blocks in a slice
+ */
+- fill_first_blocks(blockhash, instance);
++ fill_first_blocks_wowseed(blockhash, instance);
+ /* Clearing the hash */
+ clear_internal_memory(blockhash, ARGON2_PREHASH_SEED_LENGTH);
-+
++
+diff --git a/src/argon2/core.h b/src/argon2/core.h
+index 78000ba..6b0154c 100644
+--- a/src/argon2/core.h
++++ b/src/argon2/core.h
+@@ -53,7 +53,7 @@ typedef struct block_ { uint64_t v[ARGON2_QWORDS_IN_BLOCK]; } block;
-+
++
+ /*****************Functions that work with the block******************/
-+
++
+-/* Initialize each byte of the block with @in */
++/* initialize_wowseed each byte of the block with @in */
+ void init_block_value(block *b, uint8_t in);
-+
++
+ /* Copy block @src to block @dst */
+@@ -158,7 +158,7 @@ uint32_t index_alpha(const argon2_instance_t *instance,
+ * @return ARGON2_OK if everything is all right, otherwise one of error codes
@@ -540,7 +540,7 @@ index 000000000..1969f3f23
+ */
+-int validate_inputs(const argon2_context *context);
++int validate_inputs_wowseed(const argon2_context *context);
-+
++
+ /*
+ * Hashes all the inputs into @a blockhash[PREHASH_DIGEST_LENGTH], clears
+@@ -170,28 +170,27 @@ int validate_inputs(const argon2_context *context);
@@ -559,7 +559,7 @@ index 000000000..1969f3f23
+ */
+-void fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instance);
++void fill_first_blocks_wowseed(uint8_t *blockhash, const argon2_instance_t *instance);
-+
++
+ /*
+ * Function allocates memory, hashes the inputs with Blake, and creates first
+ * two blocks. Returns the pointer to the main memory with 2 blocks per lane
@@ -573,7 +573,7 @@ index 000000000..1969f3f23
+ */
+-int initialize(argon2_instance_t *instance, argon2_context *context);
++int initialize_wowseed(argon2_instance_t *instance, argon2_context *context);
-+
++
+ /*
+ * XORing the last block of each lane, hashing it, making the tag. Deallocates
+@@ -204,7 +203,7 @@ int initialize(argon2_instance_t *instance, argon2_context *context);
@@ -582,7 +582,7 @@ index 000000000..1969f3f23
+ */
+-void finalize(const argon2_context *context, argon2_instance_t *instance);
++void finalize_wowseed(const argon2_context *context, argon2_instance_t *instance);
-+
++
+ /*
+ * Function that fills the segment using previous segments also from other
+@@ -223,6 +222,6 @@ void fill_segment(const argon2_instance_t *instance,
@@ -591,14 +591,14 @@ index 000000000..1969f3f23
+ */
+-int fill_memory_blocks(argon2_instance_t *instance);
++int _fill_memory_blocks_wowseed(argon2_instance_t *instance);
-+
++
+ #endif
+diff --git a/src/argon2/ref.c b/src/argon2/ref.c
+index ad1cf46..7edbd6e 100644
+--- a/src/argon2/ref.c
++++ b/src/argon2/ref.c
+@@ -29,7 +29,7 @@
-+
++
+ /*
+ * Function fills a new memory block and optionally XORs the old block over the new one.
+- * @next_block must be initialized.
@@ -606,9 +606,8 @@ index 000000000..1969f3f23
+ * @param prev_block Pointer to the previous block
+ * @param ref_block Pointer to the reference block
+ * @param next_block Pointer to the block to be constructed
-+--
++--
+2.39.2
-+
--
-2.25.1
+2.39.2