BN_ADD(3ssl) OpenSSL BN_ADD(3ssl) BN_add, BN_sub, BN_mul, BN_sqr, BN_div, BN_mod, BN_nnmod, BN_mod_add, BN_mod_sub, BN_mod_mul, BN_mod_sqr, BN_mod_sqrt, BN_exp, BN_mod_exp, BN_gcd - BIGNUMs #include int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *a, const BIGNUM *d, BN_CTX *ctx); int BN_mod(BIGNUM *rem, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); int BN_nnmod(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx); int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); BN_add() a b r ("r=a+b"). r BIGNUM a b. BN_sub() b a r ("r=a-b"). r BIGNUM a b. BN_mul() a b r ("r=a*b"). r BIGNUM a b. 2 BN_lshift(3). BN_sqr() a r ("r=a^2"). r a BIGNUM. BN_mul(r,a,a). BN_div() a d dv rem ("dv=a/d, rem=a%d"). dv rem NULL . a . 2 BN_rshift(3). BN_mod() BN_div() dv NULL. BN_nnmod() a m r. BN_mod_add() a b m r. BN_mod_sub() b a m r. BN_mod_mul() a b m ("r=(a*b) mod m"). r BIGNUM a b. BN_mod_mul_montgomery(3) BN_mod_mul_reciprocal(3). BN_mod_sqr() a m r. BN_mod_sqrt() a "in^2 = a (mod p)". p "" . in NULL. . BN_exp() a p r ("r=a^p"). BN_mul(). BN_mod_exp() a p m ("r=a^p % m"). BN_exp(). m BN_FLG_CONSTTIME . BN_gcd() a b r. r BIGNUM a b. ctx BN_CTX BN_CTX_new(3). BIGNUM . BN_nnmod() BN_mod_exp() BIGNUM . BN_mod_sqrt() ( p ) NULL. 1 0 . ( "if (!BN_add(r,a,b)) goto err;"). ERR_get_error(3). ERR_get_error(3), BN_CTX_new(3), BN_add_word(3), BN_set_bit(3) 2000-2024 OpenSSL. . Apache 2.0 ( ""). . LICENSE . 3 . . : . 3.6.2 7 2026 BN_ADD(3ssl)