X-Git-Url: https://www.bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=src%2Fec%2Fec_prime_i31.c;h=0586a3b5ab6d83b08712bc464139da49ce148557;hp=0f2baa0f2e0d183eac34e6eabdc103079d0761d9;hb=05520e8eae3d8c6039e8bcde58741cf4ffb18f1d;hpb=44c79c1add4cd4a217b1dd77c8421c1d3a08dcef;ds=sidebyside diff --git a/src/ec/ec_prime_i31.c b/src/ec/ec_prime_i31.c index 0f2baa0..0586a3b 100644 --- a/src/ec/ec_prime_i31.c +++ b/src/ec/ec_prime_i31.c @@ -717,6 +717,14 @@ api_order(int curve, size_t *len) return cd->order; } +static size_t +api_xoff(int curve, size_t *len) +{ + api_generator(curve, len); + *len >>= 1; + return 1; +} + static uint32_t api_mul(unsigned char *G, size_t Glen, const unsigned char *x, size_t xlen, int curve) @@ -756,7 +764,7 @@ api_muladd(unsigned char *A, const unsigned char *B, size_t len, /* * TODO: see about merging the two ladders. Right now, we do - * two independant point multiplications, which is a bit + * two independent point multiplications, which is a bit * wasteful of CPU resources (but yields short code). */ @@ -804,6 +812,7 @@ const br_ec_impl br_ec_prime_i31 = { (uint32_t)0x03800000, &api_generator, &api_order, + &api_xoff, &api_mul, &api_mulgen, &api_muladd