1
Fork 0
mirror of https://github.com/Steffo99/appunti-magistrali.git synced 2024-11-25 03:34:17 +00:00
appunti-steffo/8 - Crittografia applicata/2 - Comunicazione simmetrica/7 - Implementazioni particolari/2 - Operation framework/operation framework deterministico per crittografia simmetrica a blocchi con initialization vector.md
2023-09-21 02:46:23 +02:00

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];
}