summaryrefslogtreecommitdiff
path: root/perl/bn.txt
blob: 784e7615585a174bffa51ac839a17ae222d70bfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
BN->new()
BN->dup(a)
BN->rand(bits[,top][,bottom])

BN->hex2bn(a)
BN->bn2hex(a)
BN->dec2bn(a)
BN->bn2dec(a)
BN->bin2bn(a)
BN->bn2bin(a)
BN->mpi2bn(a)
BN->bn2mpi(a)

BN->add(a,b)
BN->sub(a,b)
BN->mul(a,b)
(div,mod)=BN->div(a,b)
BN->mod(a,b)
BN->exp(a,p)
BN->mod_mul(a,b,c)
BN->mod_exp(a,b,c)

BN->is_prime(p,num)
BN->generate_prime(bits,strong,callback)

BN->num_bits(a)
BN->cmp(a,b)
BN->ucmp(a,b)
BN->is_bit_set(a,pos)
BN->set_bit(a,pos)
BN->clear_bit(a,pos)
BN->lshift(a,num)
BN->rshift(a,num)
BN->mask_bits(a,pos)
BN->clear(a)
BN->gcd(a,b)
BN->mod_inverse(a,mod)