Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! feat: add support for ChaCha20/Poly1305 t…
Browse files Browse the repository at this point in the history
…o COSE module
  • Loading branch information
pulsastrix committed Aug 27, 2024
1 parent 173f229 commit f9be288
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/token/cose/encrypted/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ pub trait EncryptCryptoBackend: CryptoBackend {
/// # Arguments
///
/// * `key` - Symmetric key that should be used.
/// Implementations may assume that the provided key has the right length for the
/// provided algorithm, and panic if this is not the case.
/// Implementations may assume that the provided key has the right length for
/// ChaCha20/Poly1305 and panic if this is not the case.
/// * `plaintext` - Data that should be encrypted.
/// * `aad` - additional authenticated data that should be included in the calculation of the
/// authentication tag, but not encrypted.
Expand Down Expand Up @@ -333,8 +333,8 @@ pub trait EncryptCryptoBackend: CryptoBackend {
/// # Arguments
///
/// * `key` - Symmetric key that should be used.
/// Implementations may assume that the provided key has the right length for the
/// provided algorithm, and panic if this is not the case.
/// Implementations may assume that the provided key has the right length for
/// ChaCha20/Poly1305 and panic if this is not the case.
/// * `ciphertext_with_tag` - The ciphertext that should be decrypted concatenated with the
/// authentication tag that should be verified (if valid, should be the output of a
/// previous encryption as specified in
Expand Down Expand Up @@ -404,7 +404,7 @@ fn try_encrypt<B: EncryptCryptoBackend, CKP: KeyProvider>(
BTreeSet::from_iter(vec![KeyOperation::Assigned(iana::KeyOperation::Encrypt)]),
|key, alg, protected, unprotected| {
let parsed_key = CoseParsedKey::try_from(key)?;
// Check if this is a valid symmetric, determine IV.
// Check if this is a valid symmetric key, determine IV.
let (symm_key, iv) =
determine_and_check_symmetric_params(alg, parsed_key, protected, unprotected)?;
match alg {
Expand Down

0 comments on commit f9be288

Please sign in to comment.