diff --git a/tests/aesgcm.rs b/tests/aesgcm.rs index f7d4f9e99..0954e9a1e 100644 --- a/tests/aesgcm.rs +++ b/tests/aesgcm.rs @@ -7,7 +7,7 @@ use libcrux::{ aead::{ decrypt, encrypt, Aes128Key, Aes256Key, Algorithm::{Aes128Gcm, Aes256Gcm}, - EncryptError, Iv, Key, + EncryptError, InvalidArgumentError, Iv, Key, }, aes_ni_support, }; @@ -34,7 +34,10 @@ fn aesgcm_self_test() { let tag = match encrypt(&key, &mut msg, iv, aad) { Ok(t) => t, Err(e) => { - if matches!(e, EncryptError::UnsupportedAlgorithm) { + if matches!( + e, + EncryptError::InvalidArgument(InvalidArgumentError::UnsupportedAlgorithm) + ) { eprintln!("AES not supported on this architecture."); return; } else { @@ -83,7 +86,10 @@ fn aesgcm_self_test_rand() { let tag = match encrypt(&key, &mut msg, iv, aad) { Ok(t) => t, Err(e) => { - if matches!(e, EncryptError::UnsupportedAlgorithm) { + if matches!( + e, + EncryptError::InvalidArgument(InvalidArgumentError::UnsupportedAlgorithm) + ) { eprintln!("AES not supported on this architecture."); return; } else { diff --git a/tests/chachapoly.rs b/tests/chachapoly.rs index 1fc7c3b32..c1769cb71 100644 --- a/tests/chachapoly.rs +++ b/tests/chachapoly.rs @@ -12,7 +12,7 @@ use libcrux::{ aead::{ self, decrypt, encrypt, Algorithm::{self, Chacha20Poly1305}, - Chacha20Key, EncryptError, Iv, Key, Tag, + Chacha20Key, EncryptError, InvalidArgumentError, Iv, Key, Tag, }, aes_ni_support, }; @@ -176,7 +176,12 @@ fn wycheproof() { let tag = match aead::encrypt(&aead_key, &mut msg_ctxt, Iv(nonce), &aad) { Ok(v) => v, Err(e) => { - if matches!(e, EncryptError::UnsupportedAlgorithm) { + if matches!( + e, + EncryptError::InvalidArgument( + InvalidArgumentError::UnsupportedAlgorithm + ) + ) { eprintln!("AES not supported on this architecture."); *skipped_tests += 1; continue;