Interface

GaloisKeys

GaloisKeys

Members

number

# readonly size

Returns the current number of keyswitching keys. Only keys that are non-empty are counted.

View Source galois-keys.ts, line 53

Methods

# clone() → {GaloisKeys}

Clone and return a new instance of this GaloisKeys

View Source galois-keys.ts, line 183

GaloisKeys
Example
const keyA = keyGenerator.galoisKeys()
const keyB = keyA.clone()
// keyB holds a copy of keyA

# copy(key)

Copy an existing GaloisKeys and overwrite this instance
Parameters:
Name Type Description
key GaloisKeys GaloisKeys to copy

View Source galois-keys.ts, line 163

Example
const keyA = keyGenerator.galoisKeys()
const keyB = seal.GaloisKeys()
keyB.copy(keyA)
// keyB holds a copy of keyA

# delete()

Delete the underlying WASM instance. Should be called before dereferencing this object to prevent the WASM heap from growing indefinitely.

View Source galois-keys.ts, line 39

# getIndex(galoisElt) → {number}

Returns the index of a Galois key in the backing KSwitchKeys instance that corresponds to the given Galois element, assuming that it exists in the backing KSwitchKeys.
Parameters:
Name Type Description
galoisElt number The Galois element

View Source galois-keys.ts, line 64

The index of the galois element
number

# hasKey(galoisElt) → {boolean}

Returns whether a Galois key corresponding to a given Galois element exists.
Parameters:
Name Type Description
galoisElt number The Galois element

View Source galois-keys.ts, line 82

True if the key exists
boolean

# load(context, encoded)

Load a GaloisKeys from a base64 string
Parameters:
Name Type Description
context Context Encryption context to enforce
encoded string Base64 encoded string

View Source galois-keys.ts, line 131

# loadArray(context, array)

Load a GaloisKeys from an Uint8Array holding binary data
Parameters:
Name Type Description
context Context Encryption context to enforce
array Uint8Array TypedArray containing binary data

View Source galois-keys.ts, line 147

# move(key)

Move a GaloisKeys into this one and delete the old reference
Parameters:
Name Type Description
key GaloisKeys GaloisKeys to move

View Source galois-keys.ts, line 209

Example
const keyA = keyGenerator.galoisKeys()
const keyB = seal.GaloisKeys()
keyB.move(keyA)
// keyB holds a the instance of keyA.
// keyA no longer holds an instance

# save(compressionopt) → {string}

Save the Encryption Parameters to a base64 string
Parameters:
Name Type Attributes Default Description
compression ComprModeType <optional>
ComprModeType.deflate The compression mode to use

View Source galois-keys.ts, line 98

Base64 encoded string
string

# saveArray(compressionopt) → {Uint8Array}

Save the GaloisKeys as a binary Uint8Array
Parameters:
Name Type Attributes Default Description
compression ComprModeType <optional>
ComprModeType.deflate The compression mode to use

View Source galois-keys.ts, line 114

A byte array containing the GaloisKeys in binary form
Uint8Array