node-seal
Version:
Homomorphic Encryption for TypeScript or JavaScript using Microsoft SEAL
34 lines (33 loc) • 1.88 kB
TypeScript
import { CipherText, CipherTextConstructorOptions } from './cipher-text';
import { Context } from './context';
import { Exception } from './exception';
import { MemoryPoolHandle } from './memory-pool-handle';
import { PlainText } from './plain-text';
import { PublicKey } from './public-key';
import { Instance, LoaderOptions } from './seal';
import { SecretKey } from './secret-key';
import { Serializable, SerializableConstructorOptions } from './serializable';
export interface EncryptorDependencyOptions {
readonly Exception: Exception;
readonly MemoryPoolHandle: MemoryPoolHandle;
readonly CipherText: CipherTextConstructorOptions;
readonly Serializable: SerializableConstructorOptions;
}
export interface EncryptorDependencies {
({ Exception, MemoryPoolHandle, CipherText, Serializable }: EncryptorDependencyOptions): EncryptorConstructorOptions;
}
export interface EncryptorConstructorOptions {
(context: Context, publicKey: PublicKey, secretKey?: SecretKey): Encryptor;
}
export interface Encryptor {
readonly instance: Instance;
readonly unsafeInject: (instance: Instance) => void;
readonly delete: () => void;
readonly encrypt: (plainText: PlainText, cipherText?: CipherText, pool?: MemoryPoolHandle) => CipherText | void;
readonly encryptSerializable: (plainText: PlainText, pool?: MemoryPoolHandle) => Serializable;
readonly encryptSymmetric: (plainText: PlainText, cipherText?: CipherText, pool?: MemoryPoolHandle) => CipherText | void;
readonly encryptSymmetricSerializable: (plainText: PlainText, pool?: MemoryPoolHandle) => Serializable;
readonly encryptZero: (cipherText?: CipherText, pool?: MemoryPoolHandle) => CipherText | void;
readonly encryptZeroSerializable: (pool?: MemoryPoolHandle) => Serializable;
}
export declare const EncryptorInit: ({ loader }: LoaderOptions) => EncryptorDependencies;