some fixes

This commit is contained in:
cathugger 2017-10-22 11:10:13 +00:00
parent 86216787ba
commit 12b9fd5e40
2 changed files with 13 additions and 7 deletions

View file

@ -83,8 +83,12 @@
#define CPU_ALPHA
#endif
#if defined(__aarch64__)
#define CPU_AARCH64
#endif
/* 64 bit cpu */
#if defined(CPU_X86_64) || defined(CPU_IA64) || defined(CPU_SPARC64) || defined(__64BIT__) || defined(__LP64__) || defined(_LP64) || (defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64))
#if defined(CPU_X86_64) || defined(CPU_IA64) || defined(CPU_SPARC64) || defined(CPU_AARCH64) || defined(__64BIT__) || defined(__LP64__) || defined(_LP64) || (defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64))
#define CPU_64BITS
#endif

14
main.c
View file

@ -751,6 +751,7 @@ static void *dowork(void *task)
#endif
memcpy(secret,skprefix,skprefixlen);
wpk[PUBLIC_LEN] = 0;
memset(&pubonion,0,sizeof(pubonion));
memcpy(pubonion.raw,pkprefix,pkprefixlen);
// write version later as it will be overwritten by hash
@ -786,7 +787,7 @@ again:
size_t j;
for (int w = 1;;) {
DOFILTER(j,wpk,goto secondfind);
goto again;
goto next;
secondfind:
if (++w >= numwords)
break;
@ -804,9 +805,10 @@ again:
// base32
strcpy(base32_to(&sname[direndpos],pk,PUBONION_LEN), ".onion");
onionready(sname, secret, pubonion.raw);
pubonion.i.hash[0] = 0;
pk[PUBLIC_LEN] = 0;
goto initseed;
});
next:
addseed(seed);
goto again;
@ -851,6 +853,7 @@ static void *dofastwork(void *task)
#endif
memcpy(secret, skprefix, skprefixlen);
wpk[PUBLIC_LEN] = 0;
memset(&pubonion,0,sizeof(pubonion));
memcpy(pubonion.raw, pkprefix, pkprefixlen);
// write version later as it will be overwritten by hash
@ -885,7 +888,7 @@ initseed:
size_t j;
for (int w = 1;;) {
DOFILTER(j,wpk,goto secondfind);
goto again;
goto next;
secondfind:
if (++w >= numwords)
break;
@ -915,12 +918,11 @@ initseed:
// full name
strcpy(base32_to(&sname[direndpos],pk,PUBONION_LEN),".onion");
onionready(sname,secret,pubonion.raw);
pubonion.i.hash[0] = 0;
pk[PUBLIC_LEN] = 0;
// don't reuse same seed
goto initseed;
});
again:
// next
next:
ge_add(&sum, &ge_public,&ge_eightpoint);
ge_p1p1_to_p3(&ge_public,&sum);
ge_p3_tobytes(pk,&ge_public);