X-Git-Url: https://bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=src%2Fint%2Fi62_modpow2.c;h=2db537f0a80a3ece1088879b2174726bfbe4c4be;hp=0414e5f0b8d340c7a126b385101e837d6f4e6246;hb=491a45337de8dc0a4c100abf33f5c0e187a08afd;hpb=a0054ad8212ecf0f31608fee60cafb32fbde789d diff --git a/src/int/i62_modpow2.c b/src/int/i62_modpow2.c index 0414e5f..2db537f 100644 --- a/src/int/i62_modpow2.c +++ b/src/int/i62_modpow2.c @@ -244,7 +244,7 @@ br_i62_modpow_opt(uint32_t *x31, const unsigned char *e, size_t elen, mw62num = (mw31num + 1) >> 1; /* - * In order to apply this function, we must have enough room tp + * In order to apply this function, we must have enough room to * copy the operand and modulus into the temporary array, along * with at least two temporaries. If there is not enough room, * switch to br_i31_modpow(). We also use br_i31_modpow() if the @@ -477,3 +477,17 @@ br_i62_modpow_opt(uint32_t *x31, const unsigned char *e, size_t elen, } #endif + +/* see inner.h */ +uint32_t +br_i62_modpow_opt_as_i31(uint32_t *x31, const unsigned char *e, size_t elen, + const uint32_t *m31, uint32_t m0i31, uint32_t *tmp, size_t twlen) +{ + /* + * As documented, this function expects the 'tmp' argument to be + * 64-bit aligned. This is OK since this function is internal (it + * is not part of BearSSL's public API). + */ + return br_i62_modpow_opt(x31, e, elen, m31, m0i31, + (uint64_t *)tmp, twlen >> 1); +}