Lines Matching defs:bn
91 #include <openssl/bn.h>
261 static int bn2gmp(const BIGNUM *bn, mpz_t g)
263 bn_check_top(bn);
264 if(((sizeof(bn->d[0]) * 8) == GMP_NUMB_BITS) &&
268 if(!_mpz_realloc (g, bn->top))
270 memcpy(&g->_mp_d[0], &bn->d[0], bn->top * sizeof(bn->d[0]));
271 g->_mp_size = bn->top;
272 if(bn->neg)
279 char *tmpchar = BN_bn2hex(bn);
287 static int gmp2bn(mpz_t g, BIGNUM *bn)
289 if(((sizeof(bn->d[0]) * 8) == GMP_NUMB_BITS) &&
294 BN_zero(bn);
295 if(bn_expand2 (bn, s) == NULL)
297 bn->top = s;
298 memcpy(&bn->d[0], &g->_mp_d[0], s * sizeof(bn->d[0]));
299 bn_correct_top(bn);
300 bn->neg = g->_mp_size >= 0 ? 0 : 1;
309 toret = BN_hex2bn(&bn, tmpchar);