refactor(server::crypto): use fixed-size [u8; 32] and KeyCell throughout seal key API

This commit is contained in:
CleverWild
2026-06-12 21:15:07 +02:00
committed by Skipper
parent a7c53aa9b6
commit 4bb408e509
12 changed files with 53 additions and 69 deletions

View File

@@ -21,6 +21,15 @@ impl From<SafeCell<Key>> for KeyCell {
Self(value)
}
}
impl From<[u8; 32]> for KeyCell {
fn from(bytes: [u8; 32]) -> Self {
let cell = SafeCell::new_inline_default(|key: &mut Key| {
key.copy_from_slice(&bytes);
});
Self(cell)
}
}
impl TryFrom<SafeCell<Vec<u8>>> for KeyCell {
type Error = ();