bc-lib  1.1.0
Library with block ciphers implementation
bc-lib

Warning This library is implemented for research purposes only! It intentionally doesn't verify some parameters for validity. In real world all parameters MUST be properly verified.

Tests codecov

Supported block ciphers

This library implements not so many cryptographic algorithms, because, as it was said above, it was developed during my research about full disk encryption (FDE) and does't aim to seize all existing block ciphers.

Kuznyechik (GOST 34.12-2018)

For algorithm specification you shuld refer to GOST 34.12-2018. Here is usage example:

//
// Initialize block cipher interface (this is the only way to use ciphers)
//
BLOCK_CIPHER cipher;
//
// Create encryption and decryption key schedules from a 256-bit binary key
//
KEY ekey;
KEY dkey;
cipher->initialize_encrypt_key(binary_key, &ekey);
cipher->initialize_decrypt_key(binary_key, &dkey);
//
// And now encrypt plaintext block
//
__m128i plaintext_block = ...;
__m128i ciphertext_block = ...;
cipher->encrypt_block(plaintext_block, &ekey, &ciphertext_block);
//
// Decryption is straightforward too
//
__m128i decrypted_block = ...;
cipher->decrypt_block(ciphertext_block, &dkey, &decrypted_block);
void kuznyechik_initialize_interface(BLOCK_CIPHER *cipher)
Initializes block cipher interface for Kuznyechik.
Definition: kuznyechik.c:471
Generic key representation.
Definition: interface.h:35