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