Skip to content

Commit

Permalink
fixup! fixup! fixup! feat: add support for ChaCha20/Poly1305 to COSE …
Browse files Browse the repository at this point in the history
…module
  • Loading branch information
pulsastrix committed Aug 27, 2024
1 parent 85260a0 commit 173f229
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/token/cose/util/symm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ pub(crate) fn generate_cek_for_alg<B: CryptoBackend>(
Ok(key)
}

/// Attempts to parse the given `parsed_key` as an AES symmetric key.
/// Attempts to parse the given `parsed_key` as a symmetric key.
///
/// Performs the checks required for symmetric keys suitable for AES according to
/// Performs the checks required for symmetric keys suitable for the algorithms specified in
/// [RFC 9053, Section 4](https://datatracker.ietf.org/doc/html/rfc9053#section-4).
pub(crate) fn ensure_valid_symmetric_key<BE: Display>(
algorithm: iana::Algorithm,
Expand Down Expand Up @@ -94,12 +94,12 @@ fn symmetric_key_size<BE: Display>(
}
}

/// Returns the IV length expected for the AES variant given as `alg`.
/// Returns the IV length expected for the symmetric algorithm given as `alg`.
///
/// # Errors
///
/// Returns [CoseCipherError::UnsupportedAlgorithm] if the provided algorithm is not a supported
/// AES algorithm.
/// symmetric algorithm.
pub const fn symmetric_algorithm_iv_len<BE: Display>(
alg: iana::Algorithm,
) -> Result<usize, CoseCipherError<BE>> {
Expand Down Expand Up @@ -156,8 +156,8 @@ pub const fn symmetric_algorithm_tag_len<BE: Display>(
}
}

/// Determines the key and IV for an AES AEAD operation using the provided `protected` and
/// `unprotected` headers, ensuring that the provided `parsed_key` is a valid AES key in the
/// Determines the key and IV for an AEAD operation using the provided `protected` and
/// `unprotected` headers, ensuring that the provided `parsed_key` is a valid symmetric key in the
/// process.
pub(crate) fn determine_and_check_symmetric_params<'a, BE: Display>(
alg: iana::Algorithm,
Expand Down

0 comments on commit 173f229

Please sign in to comment.