OpenBSD manual page server

Manual Page Search Parameters

BN_NIST_MOD_521(3) Library Functions Manual BN_NIST_MOD_521(3)

BN_nist_mod_192, BN_nist_mod_224, BN_nist_mod_256, BN_nist_mod_384, BN_nist_mod_521reduction modulo NIST-recommended primes

#include <openssl/bn.h>

BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);

BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);

BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);

BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);

BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);

These functions are optimized versions of BN_nnmod(3) using precomputed tables. They ignore their m argument and use the following moduli instead:

They reduce a modulo the respective prime number and place the non-negative remainder in r.

These functions are designed to save time when performing multiplications in prime fields of these specific orders. Consequently, if a is negative or larger than the square of the modulus being used, they call BN_nnmod(3) instead of attempting any optimization.

These functions return 1 on success or 0 on error.

BN_get0_nist_prime_521(3), BN_nnmod(3), EC_GFp_nist_method(3)

Digital Signature Standard (DSS), National Institute of Standards and Technology, FIPS PUB 186-4,, Information Technology Laboratory, Gaithersburg, Maryland, July 2013, Appendix D.1.2 Curves over Prime Fields.

November 21, 2022 OpenBSD-current