aarushigupta132 commented on code in PR #2701:
URL: https://github.com/apache/iceberg-rust/pull/2701#discussion_r3611421465
##########
crates/iceberg/src/encryption/key_metadata.rs:
##########
@@ -101,6 +104,22 @@ impl StandardKeyMetadata {
}
}
+/// AAD prefix length in bytes.
+const AAD_PREFIX_LENGTH: usize = 16;
+
+/// Generate a [`StandardKeyMetadata`] with a fresh random DEK and AAD prefix,
+/// sized to `key_size`.
+pub(crate) fn generate_standard_key_metadata(key_size: AesKeySize) ->
StandardKeyMetadata {
+ let dek = SecureKey::generate(key_size);
+
StandardKeyMetadata::new(dek.as_bytes()).with_aad_prefix(&generate_aad_prefix())
Review Comment:
thank you for the review again, also resolved this 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]