X-Git-Url: https://www.bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=inc%2Fbearssl_ec.h;h=1ecb4cdcffe54b9347cc9f3454e0773c63e8c31e;hp=908d532052d19c83e55945188da1c8a41363799c;hb=693d2a0085f4c1d289cb6d79c02ddd23f18d9478;hpb=44c79c1add4cd4a217b1dd77c8421c1d3a08dcef diff --git a/inc/bearssl_ec.h b/inc/bearssl_ec.h index 908d532..1ecb4cd 100644 --- a/inc/bearssl_ec.h +++ b/inc/bearssl_ec.h @@ -218,6 +218,12 @@ /** \brief Identifier for named curve brainpoolP512r1. */ #define BR_EC_brainpoolP512r1 28 +/** \brief Identifier for named curve Curve25519. */ +#define BR_EC_curve25519 29 + +/** \brief Identifier for named curve Curve448. */ +#define BR_EC_curve448 30 + /** * \brief Structure for an EC public key. */ @@ -404,14 +410,31 @@ extern const br_ec_impl br_ec_prime_i31; extern const br_ec_impl br_ec_prime_i15; /** - * \brief EC implementation "i15" for P-256. + * \brief EC implementation "m15" for P-256. * * This implementation uses specialised code for curve secp256r1 (also - * known as NIST P-256), with Karatsuba decomposition, and fast modular - * reduction thanks to the field modulus special format. Only 32-bit - * multiplications are used (with 32-bit results, not 64-bit). + * known as NIST P-256), with optional Karatsuba decomposition, and fast + * modular reduction thanks to the field modulus special format. Only + * 32-bit multiplications are used (with 32-bit results, not 64-bit). + */ +extern const br_ec_impl br_ec_p256_m15; + +/** + * \brief EC implementation "i15" (generic code) for Curve25519. + * + * This implementation uses the generic code for modular integers (with + * 15-bit words) to support Curve25519. The `muladd()` method is not + * implemented. + */ +extern const br_ec_impl br_ec_c25519_i15; + +/** + * \brief EC implementation "m15" (specialised code) for Curve25519. + * + * This implementation uses custom code relying on multiplication of + * integers up to 15 bits. The `muladd()` method is not implemented. */ -extern const br_ec_impl br_ec_p256_i15; +extern const br_ec_impl br_ec_c25519_m15; /** * \brief Convert a signature from "raw" to "asn1".