mirror of
https://github.com/Steffo99/appunti-magistrali.git
synced 2024-11-24 19:24:19 +00:00
11 lines
427 B
Markdown
11 lines
427 B
Markdown
|
[[operation framework deterministico]] per [[crittografia simmetrica]] con [[nonce]] (come un [[cifrario a flusso]]).
|
||
|
|
||
|
Prevede i seguenti metodi:
|
||
|
```rust
|
||
|
trait EncryptorStreamBasedWithNonce<const KEY_SIZE> {
|
||
|
fn keygen() -> [u8; KEY_SIZE];
|
||
|
fn encrypt(key: &[u8; KEY_SIZE], nonce: usize, plaintext: Iterator<u8>) -> Iterator<u8>;
|
||
|
fn decrypt(key: &[u8; KEY_SIZE], nonce: usize, ciphertext: Iterator<u8>) -> Iterator<u8>;
|
||
|
}
|
||
|
```
|