mirror of
https://github.com/Steffo99/appunti-magistrali.git
synced 2024-11-25 11:34:18 +00:00
555 B
555 B
operation framework deterministico per crittografia simmetrica con initialization vector (come un cifrario a blocchi in cipher block chaining operation mode).
Prevede i seguenti metodi:
trait EncryptorBlockByBlockWithInitializationVector<const BLOCK_SIZE, const KEY_SIZE> {
fn keygen() -> [u8; KEY_SIZE];
fn encrypt(key: &[u8; KEY_SIZE], iv: [u8; BLOCK_SIZE], plaintext: [u8; BLOCK_SIZE]) -> [u8; BLOCK_SIZE];
fn decrypt(key: &[u8; KEY_SIZE], iv: [u8; BLOCK_SIZE], ciphertext: [u8; BLOCK_SIZE]) -> [u8; BLOCK_SIZE];
}