Interface

KeyGenerator

KeyGenerator

Methods

# createGaloisKeys(stepsopt) → {GaloisKeys}

Generates and returns Galois keys. This function returns Galois keys in a fully expanded form and is meant to be used primarily for demo, testing, and debugging purposes. The user can optionally give an input a vector of desired Galois rotation step counts, where negative step counts correspond to rotations to the right and positive step counts correspond to rotations to the left. A step count of zero can be used to indicate a column rotation in the BFV scheme complex conjugation in the CKKS scheme.
Parameters:
Name Type Attributes Default Description
steps Int32Array <optional>
Int32Array.from([]) Specific Galois Elements to generate

View Source key-generator.ts, line 159

New GaloisKeys from the KeyGenerator's internal secret key
GaloisKeys

# createGaloisKeysSerializable(stepsopt) → {Serializable.<GaloisKeys>}

Generates and returns Galois keys as a serializable object. This function creates specific Galois keys that can be used to apply specific Galois automorphisms on encrypted data. The user can optionally give an input a vector of desired Galois rotation step counts, where negative step counts correspond to rotations to the right and positive step counts correspond to rotations to the left. A step count of zero can be used to indicate a column rotation in the BFV scheme complex conjugation in the CKKS scheme. Half of the key data is pseudo-randomly generated from a seed to reduce the object size. The resulting serializable object cannot be used directly and is meant to be serialized for the size reduction to have an impact.
Parameters:
Name Type Attributes Default Description
steps Int32Array <optional>
Int32Array.from([]) Specific Galois Elements to generate

View Source key-generator.ts, line 183

Base64 encoded string

# createPublicKey() → {PublicKey}

Create a new PublicKey instance

View Source key-generator.ts, line 81

A new PublicKey instance
PublicKey

# createPublicKeySerializable() → {Serializable.<PublicKey>}

Create a new, Serializable PublicKey instance

View Source key-generator.ts, line 98

A new, serializable, PublicKey instance

# createRelinKeys() → {RelinKeys}

Generates and returns relinearization keys. This function returns relinearization keys in a fully expanded form and is meant to be used primarily for demo, testing, and debugging purposes.

View Source key-generator.ts, line 116

New RelinKeys from the KeyGenerator's internal secret key
RelinKeys

# createRelinKeysSerializable() → {Serializable.<RelinKeys>}

Generates and returns relinearization keys as a serializable object. Half of the key data is pseudo-randomly generated from a seed to reduce the object size. The resulting serializable object cannot be used directly and is meant to be serialized for the size reduction to have an impact.

View Source key-generator.ts, line 135

New, serializable RelinKeys from the KeyGenerator's internal secret key

# delete()

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

View Source key-generator.ts, line 49

# secretKey() → {SecretKey}

Return the generated SecretKey

View Source key-generator.ts, line 63

The secret key that was generated upon instantiation of this KeyGenerator
SecretKey