FF
FF
Kind: global class
this: {"{"}FF{"}"}
- FF
- new FF()
- instance
- .set(m)
- .copy(b)
- .rcopy(b)
- .dsucopy()
- .dscopy()
- .sducopy()
- .iszilch()
- .shrw()
- .shlw()
- .parity()
- .radd()
- .rinc()
- .rsub()
- .rdec()
- .add()
- .sub()
- .revsub()
- .inc()
- .rnorm()
- .shl()
- .shr()
- .toString()
- .toBytes()
- .karmul()
- .lmul()
- .mod()
- .reduce(N, ND) ⇒
- .dmod(b) ⇒
- .invmodp()
- .nres()
- .invmod2m()
- .randomnum()
- .modmul()
- .modsqr()
- .skpow(e, p)
- .skspow(e, p)
- .power(e, p)
- .pow(e, p)
- .pow2(e, y, f, p)
- .cfactor(s) ⇒
- static
new FF()
Creates an instance of FF.
fF.set(m)
set to integer
Kind: instance method of FF
this: {"{"}FF{"}"}
Param | Description |
---|---|
m | Integer value to be set to |
fF.copy(b)
copy from FF b
Kind: instance method of FF
this: {"{"}FF{"}"}
Param | Description |
---|---|
b | FF element to copy from |
fF.rcopy(b)
copy from FF b
Kind: instance method of FF
this: {"{"}FF{"}"}
Param | Description |
---|---|
b | FF element to copy from |
fF.dsucopy()
x=y<<n
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.dscopy()
x=y
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.sducopy()
x=y>>n
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.iszilch()
test equals 0
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.shrw()
shift right by BIGBITS-bit words
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.shlw()
shift left by BIGBITS-bit words
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.parity()
extract last bit
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.radd()
recursive add
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.rinc()
recursive inc
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.rsub()
recursive sub
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.rdec()
recursive dec
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.add()
simple add
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.sub()
simple sub
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.revsub()
reverse sub
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.inc()
increment/decrement by a small integer
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.rnorm()
normalise - but hold any overflow in top part unless n<0
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.shl()
shift left by one bit
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.shr()
shift right by one bit
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.toString()
Convert to Hex String
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.toBytes()
Convert FFs to/from byte arrays
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.karmul()
z=x*y, t is workspace
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.lmul()
return low part of product this*y
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.mod()
Set b=b mod c
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.reduce(N, ND) ⇒
return this mod modulus
Kind: instance method of FF
Returns: this mod N
this: {"{"}FF{"}"}
Param | Description |
---|---|
N | Mmodulus |
ND | Montgomery Constant |
fF.dmod(b) ⇒
Reduces a double-length FF with respect to a given modulus
Kind: instance method of FF
Returns: this mod N
this: {"{"}FF{"}"}
Param | Description |
---|---|
b | Mmodulus |
fF.invmodp()
Set return=1/this mod p. Binary method - a<p on entry
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.nres()
nresidue mod m
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.invmod2m()
U=1/a mod 2^m - Arazi & Qi
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.randomnum()
generate random x
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.modmul()
this*=y mod p
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.modsqr()
this*=y mod p
Kind: instance method of FF
this: {"{"}FF{"}"}
fF.skpow(e, p)
this=this^e mod p using side-channel resistant Montgomery Ladder, for large e
Kind: instance method of FF
this: {"{"}FF{"}"}
Param | Description |
---|---|
e | exponent |
p | modulus |
fF.skspow(e, p)
this=this^e mod p using side-channel resistant Montgomery Ladder, for short e
Kind: instance method of FF
this: {"{"}FF{"}"}
Param | Description |
---|---|
e | exponent |
p | modulus |
fF.power(e, p)
raise to an integer power - right-to-left method
Kind: instance method of FF
this: {"{"}FF{"}"}
Param | Description |
---|---|
e | exponent |
p | modulus |
fF.pow(e, p)
this=this^e mod p, faster but not side channel resistant
Kind: instance method of FF
this: {"{"}FF{"}"}
Param | Description |
---|---|
e | exponent |
p | modulus |
fF.pow2(e, y, f, p)
double exponentiation r=x^e.y^f mod p
Kind: instance method of FF
this: {"{"}FF{"}"}
Param | Description |
---|---|
e | exponent |
y | FF instance |
f | exponent |
p | modulus |
fF.cfactor(s) ⇒
Test if an FF has factor in common with integer s
Kind: instance method of FF
Returns: true or false
this: {"{"}FF{"}"}
Param | Description |
---|---|
s | integerexponent |
FF.comp(a, b) ⇒
compare a and b - must be normalised, and of same length
Kind: static method of FF
Returns: zero of error codetrue or false
this: {"{"}FF{"}"}
Param | Description |
---|---|
a | FF number |
b | FF number |
FF.cswap()
in-place swapping using xor - side channel resistant - lengths must be the same
Kind: static method of FF
this: {"{"}FF{"}"}
FF.mul()
z=x*y. Assumes x and y are of same length.
Kind: static method of FF
this: {"{"}FF{"}"}
FF.sqr()
z=x^2
Kind: static method of FF
this: {"{"}FF{"}"}
FF.prime(p, rmg)
Miller-Rabin test for primality.
Kind: static method of FF
this: {"{"}FF{"}"}
Param | Description |
---|---|
p | FF instance to be tested |
rmg | an instance of a Cryptographically Secure Random Number Generator |