Block Ciphers

Index

block-cipher/block-size block-cipher/clear block-cipher/decrypt block-cipher/encrypt block-cipher/get-keyspec block-cipher/name block-cipher/new block-cipher/set-key

Reference

(block-cipher/block-size bc-obj)

Return the block size of this cipher.

(block-cipher/clear bc-obj)

Clear the internal state (such as keys) of this cipher object, but do not deallocate it. Returns `bc-obj`.

(block-cipher/decrypt bc-obj input)

Decrypt `input` data. The key must have been set beforehand. Returns decrypted data in buffer format.

(block-cipher/encrypt bc-obj input)

Encrypt `input` data. The key must have been set beforehand. Returns encrypted data in buffer format.

(block-cipher/get-keyspec mac)

Return the key spec of this cipher in format of [max-key-length min-key-length mod-key-length].

(block-cipher/name bc-obj)

Return the name of this block cipher algorithm, which may nor may not exactly match what was passed to `block-cipher/init`.

(block-cipher/new name)

Create a new cipher mode object, `name` should be for example "AES-128" or "Threefish-512". Returns `bc-obj`.

(block-cipher/set-key bc-obj key)

Set the cipher key, which is required before encrypting or decrypting. Returns `bc-obj`.