UNPKG

@li0ard/magma

Version:

Magma cipher implementation in pure TypeScript

73 lines (72 loc) 3.55 kB
/** S-Box from RFC 7836 */ export declare const ID_TC26_GOST_28147_PARAM_Z: number[][]; /** S-Box from RFC 4357 aka `CryptoPro Paramset A` */ export declare const ID_GOST_28147_89_CRYPTO_PRO_A_PARAM_SET: number[][]; /** S-Box from RFC 4357 aka `CryptoPro Paramset B` */ export declare const ID_GOST_28147_89_CRYPTO_PRO_B_PARAM_SET: number[][]; /** S-Box from RFC 4357 aka `CryptoPro Paramset C` */ export declare const ID_GOST_28147_89_CRYPTO_PRO_C_PARAM_SET: number[][]; /** S-Box from RFC 4357 aka `CryptoPro Paramset D` */ export declare const ID_GOST_28147_89_CRYPTO_PRO_D_PARAM_SET: number[][]; /** S-Box from Instruction no. 114 by State Special Communications Service of Ukraine */ export declare const DSSZZI_UA_DKE_1: number[][]; /** S-Box from Instruction no. 114 by State Special Communications Service of Ukraine */ export declare const DSSZZI_UA_DKE_2: number[][]; /** S-Box from Instruction no. 114 by State Special Communications Service of Ukraine */ export declare const DSSZZI_UA_DKE_3: number[][]; /** S-Box from Instruction no. 114 by State Special Communications Service of Ukraine */ export declare const DSSZZI_UA_DKE_4: number[][]; /** S-Box from Instruction no. 114 by State Special Communications Service of Ukraine */ export declare const DSSZZI_UA_DKE_5: number[][]; /** S-Box from Instruction no. 114 by State Special Communications Service of Ukraine */ export declare const DSSZZI_UA_DKE_6: number[][]; /** S-Box from Instruction no. 114 by State Special Communications Service of Ukraine */ export declare const DSSZZI_UA_DKE_7: number[][]; /** S-Box from Instruction no. 114 by State Special Communications Service of Ukraine */ export declare const DSSZZI_UA_DKE_8: number[][]; /** S-Box from Instruction no. 114 by State Special Communications Service of Ukraine */ export declare const DSSZZI_UA_DKE_9: number[][]; /** S-Box from Instruction no. 114 by State Special Communications Service of Ukraine */ export declare const DSSZZI_UA_DKE_10: number[][]; export declare const ID_GOST_28147_89_TEST_PARAM_SET: number[][]; export declare const ID_GOSTR_3411_94_TEST_PARAM_SET: number[][]; export declare const ID_GOSTR_3411_94_CRYPTOPRO_PARAM_SET: number[][]; export declare const EAC_PARAM_SET: number[][]; /** Implemented S-Boxes */ export declare const sboxes: { ID_TC26_GOST_28147_PARAM_Z: number[][]; ID_GOST_28147_89_CRYPTO_PRO_A_PARAM_SET: number[][]; ID_GOST_28147_89_CRYPTO_PRO_B_PARAM_SET: number[][]; ID_GOST_28147_89_CRYPTO_PRO_C_PARAM_SET: number[][]; ID_GOST_28147_89_CRYPTO_PRO_D_PARAM_SET: number[][]; ID_GOST_28147_89_TEST_PARAM_SET: number[][]; ID_GOSTR_3411_94_TEST_PARAM_SET: number[][]; ID_GOSTR_3411_94_CRYPTOPRO_PARAM_SET: number[][]; EAC_PARAM_SET: number[][]; DSSZZI_UA_DKE_1: number[][]; DSSZZI_UA_DKE_2: number[][]; DSSZZI_UA_DKE_3: number[][]; DSSZZI_UA_DKE_4: number[][]; DSSZZI_UA_DKE_5: number[][]; DSSZZI_UA_DKE_6: number[][]; DSSZZI_UA_DKE_7: number[][]; DSSZZI_UA_DKE_8: number[][]; DSSZZI_UA_DKE_9: number[][]; DSSZZI_UA_DKE_10: number[][]; }; /** Magma block size */ export declare const BLOCK_SIZE = 8; /** Magma key size */ export declare const KEY_SIZE = 32; /** Type for S-Box representation */ export type Sbox = number[][]; /** Wrapper for default `Error` class */ export declare class CipherError extends Error { constructor(message: string); } /** Sequences of `K_i` S-Box applying */ export declare const keySequences: { ENCRYPT: number[]; DECRYPT: number[]; MAC: number[]; };