mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-24 20:45:17 -07:00
Just use constants instead of macros
In this context, they are actually less confusing.
This commit is contained in:
parent
b1bf478086
commit
f783552773
@ -27,8 +27,8 @@ crypto_sign_ed25519_seed_keypair(unsigned char *pk, unsigned char *sk,
|
|||||||
ge_scalarmult_base(&A, sk);
|
ge_scalarmult_base(&A, sk);
|
||||||
ge_p3_tobytes(pk, &A);
|
ge_p3_tobytes(pk, &A);
|
||||||
|
|
||||||
memmove(sk, seed, crypto_sign_ed25519_SECRETKEYBYTES);
|
memmove(sk, seed, 32);
|
||||||
memmove(sk + 32, pk, crypto_sign_ed25519_PUBLICKEYBYTES);
|
memmove(sk + 32, pk, 32);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -81,11 +81,9 @@ crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk,
|
|||||||
unsigned char h[crypto_hash_sha512_BYTES];
|
unsigned char h[crypto_hash_sha512_BYTES];
|
||||||
|
|
||||||
#ifdef ED25519_NONDETERMINISTIC
|
#ifdef ED25519_NONDETERMINISTIC
|
||||||
memcpy(h, ed25519_sk, crypto_sign_ed25519_SECRETKEYBYTES);
|
memcpy(h, ed25519_sk, 32);
|
||||||
#else
|
#else
|
||||||
crypto_hash_sha512(h, ed25519_sk,
|
crypto_hash_sha512(h, ed25519_sk, 32);
|
||||||
crypto_sign_ed25519_SECRETKEYBYTES -
|
|
||||||
crypto_sign_ed25519_PUBLICKEYBYTES);
|
|
||||||
#endif
|
#endif
|
||||||
h[0] &= 248;
|
h[0] &= 248;
|
||||||
h[31] &= 127;
|
h[31] &= 127;
|
||||||
|
Loading…
Reference in New Issue
Block a user