Skip to main content

rewrap

Function rewrap 

Source
pub fn rewrap(
    container: &[u8],
    old_kek: &[u8; 32],
    new_kek: &[u8; 32],
    wrap_nonce: &[u8; 24],
    wrapped_dek: &[u8; 48],
    new_wrap_nonce: &[u8; 24],
) -> Result<[u8; 48], BlobError>
Expand description

Rewrap this blob’s DEK under a new KEK without touching its ciphertext.

The AAD is the container’s own header bytes, which do not change — the KEK LABEL lives in the header, so a rewrap under a differently-labeled key would invalidate it. Rotation therefore keeps the label and changes the key behind it, which is what “rewrap changes only the wrapped DEK” means in practice.