1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
|
From 6b220ce6f3bb9f57375d6bf06b70f82f043856c8 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Thu, 25 Apr 2024 10:06:04 +0200
Subject: [PATCH 10/14] build wownero-seed
---
contrib/depends/hosts/android.mk | 3 +-
contrib/depends/hosts/darwin.mk | 1 +
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 | 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
diff --git a/contrib/depends/hosts/android.mk b/contrib/depends/hosts/android.mk
index d6f8b99dd..5b2309972 100644
--- a/contrib/depends/hosts/android.mk
+++ b/contrib/depends/hosts/android.mk
@@ -6,7 +6,8 @@ endif
android_CC=$(host_toolchain)clang
android_CXX=$(host_toolchain)clang++
-android_RANLIB=:
+android_RANLIB=$(host_toolchain)ranlib
+android_AR=$(host_toolchain)ar
android_CFLAGS=-pipe
android_CXXFLAGS=$(android_CFLAGS)
diff --git a/contrib/depends/hosts/darwin.mk b/contrib/depends/hosts/darwin.mk
index cbe795081..ce2f5669d 100644
--- a/contrib/depends/hosts/darwin.mk
+++ b/contrib/depends/hosts/darwin.mk
@@ -9,6 +9,7 @@ darwin_CC=clang -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --s
darwin_CXX=clang++ -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(host_prefix)/native/SDK/ -mlinker-version=$(LD64_VERSION) -stdlib=libc++ -B$(host_prefix)/native/bin/$(host)-
darwin_RANLIB=$(host_prefix)/native/bin/$(host)-ranlib
+darwin_AR=$(host_prefix)/native/bin/$(host)-ar
darwin_CFLAGS=-pipe
darwin_CXXFLAGS=$(darwin_CFLAGS)
diff --git a/contrib/depends/hosts/mingw32.mk b/contrib/depends/hosts/mingw32.mk
index ccc4c5082..4677694a6 100644
--- a/contrib/depends/hosts/mingw32.mk
+++ b/contrib/depends/hosts/mingw32.mk
@@ -2,6 +2,9 @@ mingw32_CFLAGS=-pipe
mingw32_CXXFLAGS=$(mingw32_CFLAGS)
mingw32_ARFLAGS=cr
+mingw32_RANLIB=$(shell which $(host)-ranlib)
+mingw32_AR=$(shell which $(host)-ar)
+
mingw32_release_CFLAGS=-O2
mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS)
diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk
index 8783d4955..3d513c5a2 100644
--- a/contrib/depends/packages/packages.mk
+++ b/contrib/depends/packages/packages.mk
@@ -1,4 +1,4 @@
-packages:=boost openssl zeromq libiconv expat unbound polyseed
+packages:=boost openssl zeromq libiconv expat unbound polyseed wownero_seed
# ccache is useless in gitian builds
ifneq ($(GITIAN),1)
diff --git a/contrib/depends/packages/wownero_seed.mk b/contrib/depends/packages/wownero_seed.mk
new file mode 100644
index 000000000..b376f80c5
--- /dev/null
+++ b/contrib/depends/packages/wownero_seed.mk
@@ -0,0 +1,35 @@
+package=wownero_seed
+$(package)_version=0.3.0
+$(package)_download_path=https://github.com/MrCyjaneK/wownero-seed/archive/
+$(package)_download_file=d3f68be347facfeebbd8f68fd74982c705cb917b.tar.gz
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=3b59ccde08e0fee204680240af4b270a18a677aa0e6036a3504570193d232406
+$(package)_patches=0001-fix-duplicate-symbol-error.patch
+
+define $(package)_preprocess_cmds
+ patch -p1 < $($(package)_patch_dir)/0001-fix-duplicate-symbol-error.patch
+endef
+
+
+ifeq ($(host_os),darwin)
+ define $(package)_config_cmds
+ CC="$($(package)_cc)" CXX="$($(package)_cxx)" cmake -DCMAKE_RANLIB="$($(package)_ranlib)" -DCMAKE_AR="$($(package)_ar)" -DCMAKE_INSTALL_PREFIX="$(host_prefix)" -DCMAKE_POSITION_INDEPENDENT_CODE=ON .
+ endef
+else
+ define $(package)_config_cmds
+ CC="$($(package)_cc)" CXX="$($(package)_cxx)" cmake -DCMAKE_INSTALL_PREFIX="$(host_prefix)" -DCMAKE_POSITION_INDEPENDENT_CODE=ON .
+ endef
+endif
+
+define $(package)_set_vars
+ $(package)_build_opts=CC="$($(package)_cc)" CXX="$($(package)_cxx)"
+endef
+
+
+define $(package)_build_cmds
+ CC="$($(package)_cc)" CXX="$($(package)_cxx)" $(MAKE) VERBOSE=1
+endef
+
+define $(package)_stage_cmds
+ CC="$($(package)_cc)" CXX="$($(package)_cxx)" $(MAKE) DESTDIR=$($(package)_staging_dir) install
+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..a8f8fe059
--- /dev/null
+++ b/contrib/depends/patches/wownero_seed/0001-fix-duplicate-symbol-error.patch
@@ -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
+Subject: [PATCH] fix duplicate symbol error
+
+---
+ src/argon2/argon2.c | 8 +++---
+ src/argon2/argon2.h | 4 +--
+ src/argon2/blake2/blake2.h | 12 ++++-----
+ src/argon2/blake2/blake2b.c | 46 ++++++++++++++++----------------
+ src/argon2/core.c | 52 ++++++++++++++++++-------------------
+ src/argon2/core.h | 17 ++++++------
+ src/argon2/ref.c | 2 +-
+ 7 files changed, 70 insertions(+), 71 deletions(-)
+
+diff --git a/src/argon2/argon2.c b/src/argon2/argon2.c
+index e9882b7..470dc26 100644
+--- 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
+index 1b471f6..f60e269 100644
+--- a/src/argon2/argon2.h
++++ b/src/argon2/argon2.h
+@@ -185,7 +185,7 @@ typedef void (*deallocate_fptr)(uint8_t *memory, size_t bytes_to_allocate);
+ * 4 parallel lanes.
+ * You want to erase the password, but you're OK with last pass not being
+ * erased. You want to use the default memory allocator.
+- * Then you initialize:
++ * Then you initialize_wowseed:
+ Argon2_Context(out,8,pwd,32,salt,16,NULL,0,NULL,0,5,1<<20,4,4,NULL,NULL,true,false,false,false)
+ */
+ 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()
++ * Encoded string is restricted as in validate_inputs_wowseed()
+ * @param encoded String encoding parameters, salt, hash
+ * @param pwd Pointer to password
+ * @pre Returns ARGON2_OK if successful
+diff --git a/src/argon2/blake2/blake2.h b/src/argon2/blake2/blake2.h
+index 9f97e1c..25b445d 100644
+--- a/src/argon2/blake2/blake2.h
++++ 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,
++ARGON2_LOCAL int blake2b_init_wowseed(blake2b_state *S, size_t outlen);
++ARGON2_LOCAL int blake2b_init_key_wowseed(blake2b_state *S, size_t outlen, const void *key,
+ size_t keylen);
+-ARGON2_LOCAL int blake2b_init_param(blake2b_state *S, const blake2b_param *P);
+-ARGON2_LOCAL int blake2b_update(blake2b_state *S, const void *in, size_t inlen);
+-ARGON2_LOCAL int blake2b_final(blake2b_state *S, void *out, size_t outlen);
++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
+--- a/src/argon2/blake2/blake2b.c
++++ b/src/argon2/blake2/blake2b.c
+@@ -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);
+ return -1;
+ }
+@@ -156,7 +156,7 @@ int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key,
+ uint8_t block[BLAKE2B_BLOCKBYTES];
+ memset(block, 0, BLAKE2B_BLOCKBYTES);
+ memcpy(block, key, keylen);
+- blake2b_update(S, block, BLAKE2B_BLOCKBYTES);
++ blake2b_update_wowseed(S, block, BLAKE2B_BLOCKBYTES);
+ /* Burn the key from stack */
+ clear_internal_memory(block, BLAKE2B_BLOCKBYTES);
+ }
+@@ -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) {
+ blake2b_state S;
+ 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) {
+ goto fail;
+ }
+ } else {
+- if (blake2b_init(&S, outlen) < 0) {
++ if (blake2b_init_wowseed(&S, outlen) < 0) {
+ 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)));
+- TRY(blake2b_update(&blake_state, in, inlen));
+- TRY(blake2b_final(&blake_state, out, outlen));
++ TRY(blake2b_init_wowseed(&blake_state, outlen));
++ TRY(blake2b_update_wowseed(&blake_state, outlen_bytes, sizeof(outlen_bytes)));
++ TRY(blake2b_update_wowseed(&blake_state, in, inlen));
++ TRY(blake2b_final_wowseed(&blake_state, out, outlen));
+ } else {
+ uint32_t toproduce;
+ uint8_t out_buffer[BLAKE2B_OUTBYTES];
+ uint8_t in_buffer[BLAKE2B_OUTBYTES];
+- TRY(blake2b_init(&blake_state, BLAKE2B_OUTBYTES));
+- TRY(blake2b_update(&blake_state, outlen_bytes, sizeof(outlen_bytes)));
+- TRY(blake2b_update(&blake_state, in, inlen));
+- TRY(blake2b_final(&blake_state, out_buffer, BLAKE2B_OUTBYTES));
++ TRY(blake2b_init_wowseed(&blake_state, BLAKE2B_OUTBYTES));
++ TRY(blake2b_update_wowseed(&blake_state, outlen_bytes, sizeof(outlen_bytes)));
++ TRY(blake2b_update_wowseed(&blake_state, in, inlen));
++ TRY(blake2b_final_wowseed(&blake_state, out_buffer, BLAKE2B_OUTBYTES));
+ 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,
++ TRY(blake2b_wowseed(out_buffer, BLAKE2B_OUTBYTES, in_buffer,
+ BLAKE2B_OUTBYTES, NULL, 0));
+ memcpy(out, out_buffer, BLAKE2B_OUTBYTES / 2);
+ 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,
+ 0));
+ memcpy(out, out_buffer, toproduce);
+ }
+diff --git a/src/argon2/core.c b/src/argon2/core.c
+index 5eafe08..c25eb53 100644
+--- a/src/argon2/core.c
++++ b/src/argon2/core.c
+@@ -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) {
+ block blockhash;
+ 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;
+ }
+- 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) {
+ return ARGON2_INCORRECT_PARAMETER;
+ }
+@@ -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;
+ /* Make the first and second block in each lane as G(H0||0||i) or
+ G(H0||1||i) */
+@@ -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) {
+ blake2b_state BlakeHash;
+ uint8_t value[sizeof(uint32_t)];
+@@ -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]; */
+ /* Hashing all inputs */
+- initial_hash(blockhash, context, instance->type);
++ initial_hash_wowseed(blockhash, context, instance->type);
+ /* Zeroing 8 extra bytes */
+ 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
+ * (all defined in <argon2.h>
+ */
+-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);
+ * @pre @a blockhash must have at least @a PREHASH_DIGEST_LENGTH bytes
+ * allocated
+ */
+-void initial_hash(uint8_t *blockhash, argon2_context *context,
++void initial_hash_wowseed(uint8_t *blockhash, argon2_context *context,
+ argon2_type type);
+-
+ /*
+ * Function creates first 2 blocks per lane
+ * @param instance Pointer to the current instance
+ * @param blockhash Pointer to the pre-hashing digest
+ * @pre blockhash must point to @a PREHASH_SEED_LENGTH allocated values
+ */
+-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
+- * initialized
++ * initialize_wowseedd
+ * @param context Pointer to the Argon2 internal structure containing memory
+ * pointer, and parameters for time and space requirements.
+ * @param instance Current Argon2 instance
+ * @return Zero if successful, -1 if memory failed to allocate. @context->state
+ * will be modified if successful.
+ */
+-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);
+ * @pre if context->free_cbk is not NULL, it should point to a function that
+ * deallocates memory
+ */
+-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,
+ * @param instance Pointer to the current instance
+ * @return ARGON2_OK if successful, @context->state
+ */
+-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.
++ * @next_block must be initialize_wowseedd.
+ * @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.45.2
|