mirror of
https://github.com/kristoferssolo/cipher-workshop.git
synced 2026-02-04 06:42:11 +00:00
test(aes): add AES-CBC NIST SP 800-38A test vectors
Add integration tests for AES-CBC mode:
- Single block encrypt/decrypt with NIST vectors
- Multi-block encrypt with NIST vectors
- Multi-block roundtrip verification
- Empty plaintext handling
- Arbitrary length plaintext
This commit is contained in:
@@ -55,9 +55,10 @@ impl CipherContext {
|
||||
}
|
||||
|
||||
fn process_cbc(&self) -> CipherResult<String> {
|
||||
let iv = self.iv.as_ref().ok_or_else(|| {
|
||||
CipherError::InvalidPadding("CBC mode requires an IV".into())
|
||||
})?;
|
||||
let iv = self
|
||||
.iv
|
||||
.as_ref()
|
||||
.ok_or_else(|| CipherError::InvalidPadding("CBC mode requires an IV".into()))?;
|
||||
|
||||
let cipher = self.algorithm.new_cbc_cipher(&self.key, iv)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user