UNPKG

node-seal

Version:

Homomorphic Encryption for TypeScript or JavaScript using Microsoft SEAL

36 lines (35 loc) 1.81 kB
import { Context } from './context'; import { Exception } from './exception'; import { GaloisKeys, GaloisKeysConstructorOptions } from './galois-keys'; import { PublicKey, PublicKeyConstructorOptions } from './public-key'; import { RelinKeys, RelinKeysConstructorOptions } from './relin-keys'; import { Instance, LoaderOptions } from './seal'; import { SecretKey, SecretKeyConstructorOptions } from './secret-key'; import { Serializable, SerializableConstructorOptions } from './serializable'; export interface KeyGeneratorDependencyOptions { readonly Exception: Exception; readonly PublicKey: PublicKeyConstructorOptions; readonly SecretKey: SecretKeyConstructorOptions; readonly RelinKeys: RelinKeysConstructorOptions; readonly GaloisKeys: GaloisKeysConstructorOptions; readonly Serializable: SerializableConstructorOptions; } export interface KeyGeneratorDependencies { ({ Exception, PublicKey, SecretKey, RelinKeys, GaloisKeys, Serializable }: KeyGeneratorDependencyOptions): KeyGeneratorConstructorOptions; } export interface KeyGeneratorConstructorOptions { (context: Context, secretKey?: SecretKey): KeyGenerator; } export interface KeyGenerator { readonly instance: Instance; readonly unsafeInject: (instance: Instance) => void; readonly delete: () => void; readonly secretKey: () => SecretKey; readonly createPublicKeySerializable: () => Serializable; readonly createPublicKey: () => PublicKey; readonly createRelinKeysSerializable: () => Serializable; readonly createRelinKeys: () => RelinKeys; readonly createGaloisKeysSerializable: (steps?: Int32Array) => Serializable; readonly createGaloisKeys: (steps?: Int32Array) => GaloisKeys; } export declare const KeyGeneratorInit: ({ loader }: LoaderOptions) => KeyGeneratorDependencies;