X-Git-Url: https://www.bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=src%2Fec%2Fec_prime_i15.c;h=0f210f240475191f7039fe1ad2e355fc0c510037;hp=bf1d00271a6aee68804e01dc2a747f9e88936f43;hb=b715b43e411dc5d5949df6f75ef7bb65952db11c;hpb=44c79c1add4cd4a217b1dd77c8421c1d3a08dcef diff --git a/src/ec/ec_prime_i15.c b/src/ec/ec_prime_i15.c index bf1d002..0f210f2 100644 --- a/src/ec/ec_prime_i15.c +++ b/src/ec/ec_prime_i15.c @@ -716,6 +716,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) @@ -757,7 +765,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). */ @@ -805,6 +813,7 @@ const br_ec_impl br_ec_prime_i15 = { (uint32_t)0x03800000, &api_generator, &api_order, + &api_xoff, &api_mul, &api_mulgen, &api_muladd