UNPKG

@li0ard/kuznyechik

Version:

Kuznyechik cipher implementation in pure TypeScript

33 lines (32 loc) 1.43 kB
import { type TArg, type TRet } from "@li0ard/gost3413"; /** * Encrypts data using the Counter with Advance Cryptographic Prolongation of Key Material (CTR-ACPKM) mode with Kuznyechik cipher * @param key Encryption key * @param data Data to be encrypted * @param iv Initialization vector */ export declare const encryptCTR_ACPKM: (key: TArg<Uint8Array>, data: TArg<Uint8Array>, iv: TArg<Uint8Array>) => TRet<Uint8Array>; /** * Decrypts data using the Counter with Advance Cryptographic Prolongation of Key Material (CTR-ACPKM) mode with Kuznyechik cipher * @param key Encryption key * @param data Data to be decrypted * @param iv Initialization vector */ export declare const decryptCTR_ACPKM: (key: TArg<Uint8Array>, data: TArg<Uint8Array>, iv: TArg<Uint8Array>) => TRet<Uint8Array>; /** * ACPKM key derivation * @param key Encryption key */ export declare const acpkmDerivation: (key: TArg<Uint8Array>) => TRet<Uint8Array>; /** * ACPKM master key derivation * @param key Encryption key * @param keySize Length of key material */ export declare const acpkmDerivationMaster: (key: TArg<Uint8Array>, keySize: number) => TRet<Uint8Array>; /** * Compute MAC with Advance Cryptographic Prolongation of Key Material (OMAC-ACPKM) with Kuznyechik cipher * @param key Encryption key * @param data Input data */ export declare const omac_ACPKM: (key: TArg<Uint8Array>, data: TArg<Uint8Array>) => TRet<Uint8Array>;