nethsm::openpgp

Function prepare_digest_data

source
fn prepare_digest_data(
    signature_type: SignatureType,
    hash: HashAlgorithm,
    digest: &[u8],
) -> Result<Cow<'_, [u8]>>
Expand description

Transforms the raw digest data for cryptographic signing.

Raw cryptographic signing primitives have special provisions that need to be taken care of when using certain combinations of signing schemes and hashing algorithms.

This function transforms the digest into bytes that are ready to be passed to raw cryptographic functions. The exact specifics of the transformations are documented inside the function.