UNPKG

node-seal

Version:

Homomorphic Encryption for TypeScript or JavaScript using Microsoft SEAL

49 lines (48 loc) 2.16 kB
import { ComprModeType } from './compr-mode-type'; import { Context } from './context'; import { Exception } from './exception'; import { MemoryPoolHandle } from './memory-pool-handle'; import { ParmsIdType, ParmsIdTypeConstructorOptions } from './parms-id-type'; import { Instance, LoaderOptions } from './seal'; import { VectorConstructorOptions } from './vector'; export interface CipherTextDependencyOptions { readonly Exception: Exception; readonly ComprModeType: ComprModeType; readonly ParmsIdType: ParmsIdTypeConstructorOptions; readonly MemoryPoolHandle: MemoryPoolHandle; readonly Vector: VectorConstructorOptions; } export interface CipherTextConstructorParams { context?: Context; parmsId?: ParmsIdType; sizeCapacity?: number; pool?: MemoryPoolHandle; } export type CipherTextDependencies = (deps: CipherTextDependencyOptions) => CipherTextConstructorOptions; export type CipherTextConstructorOptions = (params?: CipherTextConstructorParams) => CipherText; export interface CipherText { readonly instance: Instance; readonly unsafeInject: (instance: Instance) => void; readonly delete: () => void; readonly reserve: (context: Context, capacity: number) => void; readonly resize: (size: number) => void; readonly release: () => void; readonly coeffModulusSize: number; readonly polyModulusDegree: number; readonly size: number; readonly sizeCapacity: number; readonly isTransparent: boolean; readonly isNttForm: boolean; readonly parmsId: ParmsIdType; readonly scale: number; readonly setScale: (scale: number) => void; readonly pool: MemoryPoolHandle; readonly save: (compression?: ComprModeType) => string; readonly saveArray: (compression?: ComprModeType) => Uint8Array; readonly load: (context: Context, encoded: string) => void; readonly loadArray: (context: Context, array: Uint8Array) => void; readonly copy: (cipher: CipherText) => void; readonly clone: () => CipherText; readonly move: (cipher: CipherText) => void; } export declare const CipherTextInit: ({ loader }: LoaderOptions) => CipherTextDependencies;