Members
Methods
# delete()
Delete the underlying WASM instance.
Should be called before dereferencing this object to prevent the
WASM heap from growing indefinitely.
# load(encoded)
Load the Encryption Parameters from a base64 string
Parameters:
Name | Type | Description |
---|---|---|
encoded |
string
|
base64 encoded string |
# loadArray(array)
Load the Encryption Parameters from an Uint8Array holding binary data
Parameters:
Name | Type | Description |
---|---|---|
array |
Uint8Array
|
TypedArray containing binary data |
# save(compressionopt) → {string}
Save the Encryption Parameters to a base64 string
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
compression |
ComprModeType
|
<optional> |
ComprModeType.zstd | The compression mode to use |
base64 encoded string
string
# saveArray(compressionopt) → {Uint8Array}
Save the Encryption Parameters as a binary Uint8Array
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
compression |
ComprModeType
|
<optional> |
ComprModeType.zstd | The compression mode to use |
A byte array containing the CipherText in binary form
Uint8Array
# setCoeffModulus(coeffModulus)
Sets the coefficient modulus parameter. The coefficient modulus consists
of a list of distinct prime numbers, and is represented by a vector of
Modulus objects. The coefficient modulus directly affects the size
of CipherText elements, the amount of computation that the scheme can perform
(bigger is better), and the security level (bigger is worse). In Microsoft SEAL each
of the prime numbers in the coefficient modulus must be at most 60 bits,
and must be congruent to 1 modulo 2*degree(poly_modulus).
Parameters:
Name | Type | Description |
---|---|---|
coeffModulus |
Vector
|
Vector of Modulus primes |
# setPlainModulus(plainModulus)
Sets the PlainText modulus parameter. The PlainText modulus is an integer
modulus represented by the Modulus class. The PlainText modulus
determines the largest coefficient that PlainText polynomials can represent.
It also affects the amount of computation that the scheme can perform
(bigger is worse). In Microsoft SEAL the PlainText modulus can be at most 60 bits
long, but can otherwise be any integer. Note, however, that some features
(e.g. batching) require the PlainText modulus to be of a particular form.
Parameters:
Name | Type | Description |
---|---|---|
plainModulus |
Modulus
|
PlainText modulus parameter |
# setPolyModulusDegree(polyModulusDegree)
Sets the degree of the polynomial modulus parameter to the specified value.
The polynomial modulus directly affects the number of coefficients in
PlainText polynomials, the size of CipherText elements, the computational
performance of the scheme (bigger is worse), and the security level (bigger
is better). In Microsoft SEAL the degree of the polynomial modulus must be a power
of 2 (e.g. 1024, 2048, 4096, 8192, 16384, or 32768).
Parameters:
Name | Type | Description |
---|---|---|
polyModulusDegree |
number
|
The degree of the polynomial modulus |