UNPKG

@li0ard/magma

Version:

Magma cipher implementation in pure TypeScript

24 lines (23 loc) 1.01 kB
import { type Sbox } from "../"; /** * Encrypts data using Cipher Feedback (CFB) mode with Magma cipher * * @param key Encryption key * @param data Data to be encrypted * @param iv Initialization vector * @param legacy Enable backward compatibility with old GOST 28147-89 * @param sbox Optional substitution box, defaults to `ID_TC26_GOST_28147_PARAM_Z` * @returns {Uint8Array} */ export declare const encryptCFB: (key: Uint8Array, data: Uint8Array, iv: Uint8Array, legacy?: boolean, sbox?: Sbox) => Uint8Array; /** * Decrypts data using Cipher Feedback (CFB) mode with Magma cipher * * @param key Encryption key * @param data Data to be decrypted * @param iv Initialization vector * @param legacy Enable backward compatibility with old GOST 28147-89 * @param sbox Optional substitution box, defaults to `ID_TC26_GOST_28147_PARAM_Z` * @returns {Uint8Array} */ export declare const decryptCFB: (key: Uint8Array, data: Uint8Array, iv: Uint8Array, legacy?: boolean, sbox?: Sbox) => Uint8Array;