diff options
Diffstat (limited to 'src/lib/libcrypto/curve25519/curve25519.h')
| -rw-r--r-- | src/lib/libcrypto/curve25519/curve25519.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/libcrypto/curve25519/curve25519.h b/src/lib/libcrypto/curve25519/curve25519.h index 077bbbf97c..5aaa8c0869 100644 --- a/src/lib/libcrypto/curve25519/curve25519.h +++ b/src/lib/libcrypto/curve25519/curve25519.h | |||
| @@ -39,11 +39,14 @@ extern "C" { | |||
| 39 | * See http://cr.yp.to/ecdh.html and https://tools.ietf.org/html/rfc7748. | 39 | * See http://cr.yp.to/ecdh.html and https://tools.ietf.org/html/rfc7748. |
| 40 | */ | 40 | */ |
| 41 | 41 | ||
| 42 | #define X25519_KEY_LENGTH 32 | ||
| 43 | |||
| 42 | /* | 44 | /* |
| 43 | * X25519_keypair sets |out_public_value| and |out_private_key| to a freshly | 45 | * X25519_keypair sets |out_public_value| and |out_private_key| to a freshly |
| 44 | * generated, public/private key pair. | 46 | * generated, public/private key pair. |
| 45 | */ | 47 | */ |
| 46 | void X25519_keypair(uint8_t out_public_value[32], uint8_t out_private_key[32]); | 48 | void X25519_keypair(uint8_t out_public_value[X25519_KEY_LENGTH], |
| 49 | uint8_t out_private_key[X25519_KEY_LENGTH]); | ||
| 47 | 50 | ||
| 48 | /* | 51 | /* |
| 49 | * X25519 writes a shared key to |out_shared_key| that is calculated from the | 52 | * X25519 writes a shared key to |out_shared_key| that is calculated from the |
| @@ -53,8 +56,9 @@ void X25519_keypair(uint8_t out_public_value[32], uint8_t out_private_key[32]); | |||
| 53 | * Don't use the shared key directly, rather use a KDF and also include the two | 56 | * Don't use the shared key directly, rather use a KDF and also include the two |
| 54 | * public values as inputs. | 57 | * public values as inputs. |
| 55 | */ | 58 | */ |
| 56 | int X25519(uint8_t out_shared_key[32], const uint8_t private_key[32], | 59 | int X25519(uint8_t out_shared_key[X25519_KEY_LENGTH], |
| 57 | const uint8_t peers_public_value[32]); | 60 | const uint8_t private_key[X25519_KEY_LENGTH], |
| 61 | const uint8_t peers_public_value[X25519_KEY_LENGTH]); | ||
| 58 | 62 | ||
| 59 | #if defined(__cplusplus) | 63 | #if defined(__cplusplus) |
| 60 | } /* extern C */ | 64 | } /* extern C */ |
