Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 1376346

Browse files
author
Tom Galloway
committed
Merge remote-tracking branch 'upstream/master'
2 parents acb785c + 0a6afa5 commit 1376346

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

keys/guidc.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,10 @@ static char * createGUID()
4444
unsigned char sk[crypto_sign_SECRETKEYBYTES];
4545
crypto_sign_keypair(pk, sk);
4646

47-
//Sign the public key
48-
const unsigned char * message = pk;
49-
int message_len = crypto_sign_PUBLICKEYBYTES;
50-
51-
unsigned char signed_message[crypto_sign_BYTES + message_len];
52-
unsigned long long signed_message_len;
53-
54-
crypto_sign(signed_message, &signed_message_len,
55-
message, message_len, sk);
56-
57-
//Hash the signed key with sha512
58-
crypto_hash_sha512(out, signed_message, signed_message_len);
59-
char proof_of_work[32];
60-
memcpy(proof_of_work, &out[32], 32);
47+
//Hash the pubkey with sha512
48+
crypto_hash_sha512(out, pk, crypto_sign_PUBLICKEYBYTES);
49+
char proof_of_work[44];
50+
memcpy(proof_of_work, &out[20], 44);
6151
char * pow = to_hex(proof_of_work, 3);
6252
valid_pow = test_pow(pow);
6353
}

0 commit comments

Comments
 (0)