Block cipher interface.

interface BlockCipher {
    blockSize: number;
    clean(): this;
    decryptBlock(src: Uint8Array, dst: Uint8Array): this;
    encryptBlock(src: Uint8Array, dst: Uint8Array): this;
    setKey(key: Uint8Array): this;
}

Implemented by

    Properties

    blockSize: number

    Byte length of cipher block.

    Methods

    • Decrypts one block of data in src and puts the result into dst.

      Src and dst may be equal, but otherwise must not overlap.

      Parameters

      • src: Uint8Array
      • dst: Uint8Array

      Returns this

    • Encrypts one block of data in src and puts the result into dst.

      Src and dst may be equal, but otherwise must not overlap.

      Parameters

      • src: Uint8Array
      • dst: Uint8Array

      Returns this

    • Sets a new key for cipher.

      Parameters

      • key: Uint8Array

      Returns this