5 * Some Modular Arithmetic Functions.
7 * Copyright (C) Lenka Fibikova 2000
12 #ifndef HEADER_BN_MODFS_H
13 #define HEADER_BN_MODFS_H
20 #define BN_is_zero(a) (((a)->top == 0) || (((a)->top == 1) && ((a)->d[0] == (BN_ULONG)0)))
21 #endif /*BN_is_zero(a)*/
24 int BN_smod(BIGNUM *rem, BIGNUM *m, BIGNUM *d, BN_CTX *ctx);
25 int BN_mod_sub(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *m, BN_CTX *ctx);
26 int BN_mod_add(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *m, BN_CTX *ctx);
27 int BN_mod_sqr(BIGNUM *r, BIGNUM *a, BIGNUM *p, BN_CTX *ctx);
28 int BN_swap(BIGNUM *x, BIGNUM *y);
29 int BN_legendre(BIGNUM *a, BIGNUM *p, BN_CTX *ctx);
30 int BN_mod_sqrt(BIGNUM *x, BIGNUM *a, BIGNUM *p, BN_CTX *ctx);