]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/bn_int.h
Uniform bn_bn2binpad() and bn_bn2lebinpad() implementations
[thirdparty/openssl.git] / crypto / bn_int.h
CommitLineData
c9046a05
AP
1/*
2 * Some BIGNUM functions assume most significant limb to be non-zero, which
3 * is customarily arranged by bn_correct_top. Output from below functions
4 * is not processed with bn_correct_top, and for this reason it may not be
5 * returned out of public API. It may only be passed internally into other
6 * functions known to support non-minimal or zero-padded BIGNUMs.
7 */
8int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
9 BN_MONT_CTX *mont, BN_CTX *ctx);
387d170b
AP
10int bn_from_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
11 BN_CTX *ctx);
c9046a05
AP
12int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
13 BN_CTX *ctx);
83325a68
AP
14int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
15 const BIGNUM *m);
387d170b
AP
16int bn_mod_sub_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
17 const BIGNUM *m);
18int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
19int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
6412738b
AP
20
21int bn_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
bde4a001
NT
22
23BIGNUM *bn_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
24int bn_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen);