Constructors
Properties
Readonly
encodedSize
encodedSize: number
Readonly
generator
generator: bigint
Readonly
genOrder
genOrder: bigint
Readonly
modulus
modulus: bigint
Methods
add
- add(a: bigint, b: bigint): bigint
Returns bigint
additiveSecretShare
- additiveSecretShare(input: bigint[], numShares: number): bigint[][]
Parameters
- input: bigint[]
- numShares: number
Returns bigint[][]
decode
- decode(encoded: Uint8Array): bigint[]
Returns bigint[]
encode
- encode(data: bigint[]): Uint8Array
Returns Uint8Array
evalPoly
- evalPoly(p: bigint[], x: bigint): bigint
Returns bigint
exp
- exp(b: bigint, exp: bigint): bigint
Returns bigint
fillRandom
- fillRandom(length: number): bigint[]
Returns bigint[]
interpolate
- interpolate(rootsOfUnity: bigint[], ys: bigint[]): bigint[]
Parameters
- rootsOfUnity: bigint[]
- ys: bigint[]
Returns bigint[]
mul
- mul(a: bigint, b: bigint): bigint
Returns bigint
mulPolys
- mulPolys(a: bigint[], b: bigint[]): bigint[]
Returns bigint[]
randomElement
- randomElement(): bigint
Returns bigint
sub
- sub(x: bigint, y: bigint): bigint
Returns bigint
sum
- sum<T>(arr: T[], mapper: (value: T, index: number) => bigint): bigint
Parameters
- arr: T[]
- mapper: (value: T, index: number) => bigint
Returns bigint
vecAdd
- vecAdd(a: bigint[], b: bigint[]): bigint[]
Returns bigint[]
vecSub
- vecSub(a: bigint[], b: bigint[]): bigint[]
Returns bigint[]