X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fbignum.h;h=c8ba566be77f7a71bd4dfd1f30ae1dde01b8bb5d;hp=3d5ec4be41ab3d0a70177a817bb531c82cfde17f;hb=f7ad871507a82931ed5bc39a1196d3e839382b6c;hpb=146ff589c0ef8f3edf811110d67b80a963265793 diff --git a/src/bignum.h b/src/bignum.h index 3d5ec4b..c8ba566 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -78,6 +78,15 @@ public: return (*this); } + CBigNum(const BIGNUM *bnp) { + BIGNUM *dup = BN_dup(bnp); + if (!dup) + { + throw bignum_error("CBigNum::CBigNum(const BIGNUM*) : BN_dup failed"); + } + bn = dup; + } + ~CBigNum() { BN_clear_free(bn); @@ -596,7 +605,7 @@ public: */ bool isPrime(const int checks=BN_prime_checks) const { CAutoBN_CTX pctx; - int ret = BN_is_prime(bn, checks, NULL, pctx, NULL); + int ret = BN_is_prime_ex(bn, checks, pctx, NULL); if(ret < 0){ throw bignum_error("CBigNum::isPrime :BN_is_prime"); }