From 3a9b5cc6faecb4ce54f7eb645a45cc05a0b87c89 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Mon, 1 Sep 2025 16:15:57 +0530 Subject: [PATCH] simplify aes-gcm imports and add tag size constants --- core/storage/encryption.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/storage/encryption.rs b/core/storage/encryption.rs index 790efaaeb..5211f1b38 100644 --- a/core/storage/encryption.rs +++ b/core/storage/encryption.rs @@ -1,11 +1,12 @@ #![allow(unused_variables, dead_code)] use crate::{LimboError, Result}; use aegis::aegis256::Aegis256; -use aes_gcm::{ - aead::{Aead, AeadCore, KeyInit, OsRng}, - Aes256Gcm, Key, Nonce, -}; +use aes_gcm::aead::{AeadCore, OsRng}; use std::ops::Deref; +// AEGIS-256 supports both 16 and 32 byte tags, we use the 16 byte variant, it is faster +// and provides sufficient security for our use case. +const AEGIS_TAG_SIZE: usize = 16; +const AES256GCM_TAG_SIZE: usize = 16; #[repr(transparent)] #[derive(Clone)]