kuznyechik - v0.1.0
    Preparing search index...

    Class Kuznyechik

    Kuznyechik core class

    Index

    Constructors

    Methods

    • Decrypts single block of data using Kuznyechik encryption algorithm.

      Parameters

      • block: Uint8Array

        Block to be decrypted

      Returns Uint8Array

      Decrypted block

      Block size is invalid or data is too short

    • Encrypts single block of data using Kuznyechik encryption algorithm.

      Parameters

      • block: Uint8Array

        Block to be encrypted

      Returns Uint8Array

      Encrypted block

      Block size is invalid or data is too short

    • Returns round keys

      Returns Uint8Array<ArrayBufferLike>[]

    • Performs Galois Field (GF(2)) multiplication.

      This method multiplies two bytes in the Galois Field using bitwise operations, applying the irreducible polynomial x^8 + x^7 + x^6 + x + 1 for modular reduction.

      Parameters

      • a: number
      • b: number

      Returns number

    • F-transformation aka XSLX-algorithm

      Performs a key transformation using a series of linear and substitution transformations.

      Parameters

      • in_key1: Uint8Array
      • in_key2: Uint8Array
      • iter_constant: Uint8Array

      Returns Uint8Array<ArrayBufferLike>[]

    • L-transformation

      Performs a linear transformation on the input block by repeatedly applying the R-transformation a fixed number of times (equal to the block size).

      Parameters

      • input: Uint8Array

      Returns Uint8Array

    • Lrev-transformation

      Performs a linear transformation on the input block by repeatedly applying the Rrev-transformation a fixed number of times (equal to the block size).

      Parameters

      • input: Uint8Array

      Returns Uint8Array

    • R-transformation

      Performs a linear transformation on the input block by cyclically shifting bytes and applying Galois Field multiplication with a predefined linear transformation matrix (L).

      Parameters

      • input: Uint8Array

      Returns Uint8Array

    • Rrev-transformation

      Performs a linear transformation on the input block by applying Galois Field multiplication with a predefined linear transformation matrix (L) and cyclically shifting bytes.

      Parameters

      • input: Uint8Array

      Returns Uint8Array

    • S-transformation.

      The S function is a regular substitution function. Each byte of the input sequence is replaced by the corresponding byte from the PI substitution table.

      Parameters

      • input: Uint8Array

      Returns Uint8Array

    • Srev-transformation

      The Srev function is a regular substitution function. Each byte of the input sequence is replaced by the corresponding byte from the PI_REV substitution table.

      Parameters

      • input: Uint8Array

      Returns Uint8Array

    • X-transformation.

      The input of the X function is two sequences, and the output of the function is the XOR of these two sequences.

      Parameters

      • a: Uint8Array
      • b: Uint8Array

      Returns Uint8Array