2 void *worker_slow(void *task
)
4 union pubonionunion pubonion
;
5 u8
* const pk
= &pubonion
.raw
[PKPREFIX_SIZE
];
6 u8 secret
[SKPREFIX_SIZE
+ SECRET_LEN
];
7 u8
* const sk
= &secret
[SKPREFIX_SIZE
];
9 u8 hashsrc
[checksumstrlen
+ PUBLIC_LEN
+ 1];
10 u8 wpk
[PUBLIC_LEN
+ 1];
16 struct statstruct
*st
= (struct statstruct
*)task
;
22 memcpy(secret
,skprefix
,SKPREFIX_SIZE
);
24 memset(&pubonion
,0,sizeof(pubonion
));
25 memcpy(pubonion
.raw
,pkprefix
,PKPREFIX_SIZE
);
26 // write version later as it will be overwritten by hash
27 memcpy(hashsrc
,checksumstr
,checksumstrlen
);
28 hashsrc
[checksumstrlen
+ PUBLIC_LEN
] = 0x03; // version
33 randombytes(seed
,sizeof(seed
));
34 ed25519_seckey_expand(sk
,seed
);
40 if (unlikely(endwork
))
43 ed25519_pubkey(pk
,sk
);
51 shiftpk(wpk
,pk
,filter_len(i
));
54 DOFILTER(j
,wpk
,goto secondfind
);
59 shiftpk(wpk
,wpk
,filter_len(j
));
63 if ((sk
[0] & 248) != sk
[0] || ((sk
[31] & 63) | 64) != sk
[31])
69 memcpy(&hashsrc
[checksumstrlen
],pk
,PUBLIC_LEN
);
70 FIPS202_SHA3_256(hashsrc
,sizeof(hashsrc
),&pk
[PUBLIC_LEN
]);
72 pk
[PUBLIC_LEN
+ 2] = 0x03;
74 strcpy(base32_to(&sname
[direndpos
],pk
,PUBONION_LEN
),".onion");
75 onionready(sname
,secret
,pubonion
.raw
);
76 pk
[PUBLIC_LEN
] = 0; // what is this for?
86 sodium_memzero(secret
,sizeof(secret
));
87 sodium_memzero(seed
,sizeof(seed
));