mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-04-28 10:44:38 +00:00
Add bn_mul_fixed_top, bn_from_mont_fixed_top, bn_mod_sub_fixed_top. Switch to bn_{mul|sqr}_fixed_top in bn_mul_mont_fixed_top and remove memset in bn_from_montgomery_word. (cherry picked from commit fcc4ee09473cac511eca90faa003661c7786e4f9) Resolved conflicts: crypto/bn/bn_mod.c crypto/bn_int.h Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/6942)
22 lines
1.1 KiB
C
22 lines
1.1 KiB
C
/*
|
|
* Some BIGNUM functions assume most significant limb to be non-zero, which
|
|
* is customarily arranged by bn_correct_top. Output from below functions
|
|
* is not processed with bn_correct_top, and for this reason it may not be
|
|
* returned out of public API. It may only be passed internally into other
|
|
* functions known to support non-minimal or zero-padded BIGNUMs.
|
|
*/
|
|
int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
|
BN_MONT_CTX *mont, BN_CTX *ctx);
|
|
int bn_from_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
|
|
BN_CTX *ctx);
|
|
int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
|
|
BN_CTX *ctx);
|
|
int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
|
const BIGNUM *m);
|
|
int bn_mod_sub_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
|
const BIGNUM *m);
|
|
int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
|
int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
|
|
|
|
int bn_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
|