Skip to content

Commit

Permalink
Refactor a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
torben-hansen committed Jan 18, 2023
1 parent 35a9971 commit a3be553
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions crypto/curve25519/curve25519.c
Original file line number Diff line number Diff line change
Expand Up @@ -1874,9 +1874,7 @@ static void sc_muladd(uint8_t *s, const uint8_t *a, const uint8_t *b,
s[31] = s11 >> 17;
}

#define ED25519_SEED_LEN 32

void ED25519_keypair(uint8_t out_public_key[ED25519_SEED_LEN], uint8_t out_private_key[64]) {
void ED25519_keypair(uint8_t out_public_key[32], uint8_t out_private_key[64]) {
uint8_t seed[ED25519_SEED_LEN];
RAND_bytes(seed, ED25519_SEED_LEN);
ED25519_keypair_from_seed(out_public_key, out_private_key, seed);
Expand Down
1 change: 1 addition & 0 deletions include/openssl/curve25519.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ OPENSSL_EXPORT void X25519_public_from_private(uint8_t out_public_value[32],
#define ED25519_PRIVATE_KEY_LEN 64
#define ED25519_PUBLIC_KEY_LEN 32
#define ED25519_SIGNATURE_LEN 64
#define ED25519_SEED_LEN 32

// ED25519_keypair sets |out_public_key| and |out_private_key| to a freshly
// generated, public–private key pair.
Expand Down

0 comments on commit a3be553

Please sign in to comment.