Skip to content

Commit

Permalink
fix: apply code review suggestions from PR #24
Browse files Browse the repository at this point in the history
Co-authored-by: Falko Galperin <[email protected]>
  • Loading branch information
pulsastrix and falko17 authored Aug 27, 2024
1 parent 0da044a commit 40a741e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/token/cose/encrypted/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ pub trait EncryptCryptoBackend: CryptoBackend {
)))
}

/// Decrypts the given `payload` using AES-CCM with the parameters L (size of length field)
/// Decrypts the given `ciphertext_with_tag` using AES-CCM with the parameters L (size of length field)
/// and M (size of authentication tag) specified for the given `algorithm` in
/// [RFC 9053, section 4.2](https://datatracker.ietf.org/doc/html/rfc9053#section-4.2) and the
/// given `key`.
Expand All @@ -246,9 +246,9 @@ pub trait EncryptCryptoBackend: CryptoBackend {
/// previous encryption as specified in
/// [RFC 3610, Section 2.4](https://datatracker.ietf.org/doc/html/rfc3610#section-2.4)).
/// Is guaranteed to be at least as long as the authentication tag should be.
/// * `aad` - additional authenticated data that should be included in the calculation of the
/// * `aad` - Additional authenticated data that should be included in the calculation of the
/// authentication tag, but not encrypted.
/// * `iv` - Initialization vector that should be used for the encryption process.
/// * `iv` - Initialization vector that should be used for the decryption process.
/// Implementations may assume that `iv` has the correct length for the given AES-CCM
/// variant and panic if this is not the case.
///
Expand Down Expand Up @@ -301,7 +301,7 @@ pub fn aes_algorithm_iv_len<BE: Display>(
match alg {
// AES-GCM: Nonce is fixed at 96 bits (RFC 9053, Section 4.1)
iana::Algorithm::A128GCM | iana::Algorithm::A192GCM | iana::Algorithm::A256GCM => {
Ok(AES_GCM_NONCE_SIZE)
Ok(12)
}
// AES-CCM: Nonce length is parameterized.
iana::Algorithm::AES_CCM_16_64_128
Expand Down
2 changes: 1 addition & 1 deletion tests/dcaf_cose_examples/aes-ccm/empty_payload.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "AES-GCM-01: Encryption with empty payload",
"title": "AES-CCM-01: Encryption with empty payload",
"input": {
"plaintext": "",
"enveloped": {
Expand Down

0 comments on commit 40a741e

Please sign in to comment.