Add X25519 length constants. Per request for named constants at https://codereview.chromium.org/2457153003/diff/40001/net/quic/core/crypto/curve25519_key_exchange.cc#newcode27 The public one is named X25519_PUBLIC_VALUE_LEN rather than X25519_PUBLIC_KEY_LEN for consistency with the rest of the documentation. (Apparently we say "X25519 public value" and "Ed25519 public key".) Change-Id: Idb76a0a9794f0f628c3b784e50a04fdb35bf3ee6 Reviewed-on: https://boringssl-review.googlesource.com/11941 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com>
diff --git a/include/openssl/curve25519.h b/include/openssl/curve25519.h index e9ba04d..8d73f33 100644 --- a/include/openssl/curve25519.h +++ b/include/openssl/curve25519.h
@@ -33,6 +33,9 @@ * sometimes referred to as “curve25519”, but “X25519” is a more precise name. * See http://cr.yp.to/ecdh.html and https://tools.ietf.org/html/rfc7748. */ +#define X25519_PRIVATE_KEY_LEN 32 +#define X25519_PUBLIC_VALUE_LEN 32 + /* X25519_keypair sets |out_public_value| and |out_private_key| to a freshly * generated, public–private key pair. */ OPENSSL_EXPORT void X25519_keypair(uint8_t out_public_value[32],