mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-28 05:24:22 +01:00
Merge 'Clean up encryption feature flag usage' from Avinash Sajjanshetty
Closes #3178
This commit is contained in:
@@ -627,6 +627,7 @@ impl From<CipherError> for LimboError {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(feature = "encryption")]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use rand::Rng;
|
||||
@@ -635,7 +636,6 @@ mod tests {
|
||||
macro_rules! test_cipher_wrapper {
|
||||
($test_name:ident, $cipher_type:ty, $key_gen:expr, $nonce_size:literal, $message:literal) => {
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn $test_name() {
|
||||
let key = EncryptionKey::from_hex_string(&$key_gen()).unwrap();
|
||||
let cipher = <$cipher_type>::new(&key);
|
||||
@@ -656,7 +656,6 @@ mod tests {
|
||||
macro_rules! test_aes_cipher_wrapper {
|
||||
($test_name:ident, $cipher_type:ty, $key_gen:expr, $nonce_size:literal, $message:literal) => {
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn $test_name() {
|
||||
let key = EncryptionKey::from_hex_string(&$key_gen()).unwrap();
|
||||
let cipher = <$cipher_type>::new(&key).unwrap();
|
||||
@@ -677,7 +676,6 @@ mod tests {
|
||||
macro_rules! test_raw_encryption {
|
||||
($test_name:ident, $cipher_mode:expr, $key_gen:expr, $nonce_size:literal, $message:literal) => {
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn $test_name() {
|
||||
let key = EncryptionKey::from_hex_string(&$key_gen()).unwrap();
|
||||
let ctx = EncryptionContext::new($cipher_mode, &key, DEFAULT_ENCRYPTED_PAGE_SIZE)
|
||||
@@ -726,7 +724,6 @@ mod tests {
|
||||
);
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn test_aes128gcm_encrypt_decrypt_round_trip() {
|
||||
let mut rng = rand::thread_rng();
|
||||
let cipher_mode = CipherMode::Aes128Gcm;
|
||||
@@ -757,7 +754,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn test_aes_encrypt_decrypt_round_trip() {
|
||||
let mut rng = rand::thread_rng();
|
||||
let cipher_mode = CipherMode::Aes256Gcm;
|
||||
@@ -804,7 +800,6 @@ mod tests {
|
||||
);
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn test_aegis256_encrypt_decrypt_round_trip() {
|
||||
let mut rng = rand::thread_rng();
|
||||
let cipher_mode = CipherMode::Aegis256;
|
||||
@@ -850,7 +845,6 @@ mod tests {
|
||||
);
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn test_aegis128x2_encrypt_decrypt_round_trip() {
|
||||
let mut rng = rand::thread_rng();
|
||||
let cipher_mode = CipherMode::Aegis128X2;
|
||||
@@ -896,7 +890,6 @@ mod tests {
|
||||
);
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn test_aegis128l_encrypt_decrypt_round_trip() {
|
||||
let mut rng = rand::thread_rng();
|
||||
let cipher_mode = CipherMode::Aegis128L;
|
||||
@@ -942,7 +935,6 @@ mod tests {
|
||||
);
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn test_aegis128x4_encrypt_decrypt_round_trip() {
|
||||
let mut rng = rand::thread_rng();
|
||||
let cipher_mode = CipherMode::Aegis128X4;
|
||||
@@ -988,7 +980,6 @@ mod tests {
|
||||
);
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn test_aegis256x2_encrypt_decrypt_round_trip() {
|
||||
let mut rng = rand::thread_rng();
|
||||
let cipher_mode = CipherMode::Aegis256X2;
|
||||
@@ -1034,7 +1025,6 @@ mod tests {
|
||||
);
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "encryption")]
|
||||
fn test_aegis256x4_encrypt_decrypt_round_trip() {
|
||||
let mut rng = rand::thread_rng();
|
||||
let cipher_mode = CipherMode::Aegis256X4;
|
||||
|
||||
Reference in New Issue
Block a user