Interface

KeyGenerator

KeyGenerator

Methods

# 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

# galoisKeys(stepsopt) → {Serializable}

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 157

Base64 encoded string
Serializable

# galoisKeysLocal(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 132

New GaloisKeys from the KeyGenerator's internal secret key
GaloisKeys

# publicKey() → {PublicKey}

Return the generated PublicKey

View Source key-generator.ts, line 76

The public key that was generated upon instantiation of this KeyGenerator
PublicKey

# relinKeys() → {Serializable}

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 109

New RelinKeys from the KeyGenerator's internal secret key
Serializable

# relinKeysLocal() → {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 89

New RelinKeys from the KeyGenerator's internal secret key
RelinKeys

# 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