Skip to content

Commit

Permalink
Data type links in aed_cipher docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rrybarczyk committed Sep 12, 2024
1 parent bea943a commit 4b7be45
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions protocols/v2/noise-sv2/src/aed_cipher.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! # AEAD Cipher Trait
//!
//! Defines the `AeadCipher` trait which standardizes the interface for Authenticated Encryption
//! Defines the [`AeadCipher`] trait which standardizes the interface for Authenticated Encryption
//! with Associated Data (AEAD) ciphers used within the Noise protocol implementation. The trait is
//! implemented for two common cipher, `ChaCha20Poly1305` and `Aes256Gcm`, providing encryption and
//! decryption functionality with authenticated data.
//! implemented for two common cipher, [`ChaCha20Poly1305`] and [`Aes256Gcm`], providing encryption
//! and decryption functionality with authenticated data.
//!
//! ## Overview
//!
Expand All @@ -13,22 +13,23 @@
//!
//! ## Usage
//!
//! The `AeadCipher` trait is used by the `HandshakeOp` trait to perform cryptographic operations
//! during the Noise protocol handshake, ensuring secure communication between parties.
//! The [`AeadCipher`] trait is used by the [`crate::handshake::HandshakeOp`] trait to perform
//! cryptographic operations during the Noise protocol handshake, ensuring secure communication
//! between parties.

use aes_gcm::Aes256Gcm;
use chacha20poly1305::{aead::Buffer, AeadInPlace, ChaCha20Poly1305, ChaChaPoly1305, KeyInit};

/// Defines the interface for AEAD ciphers.
///
/// The `AeadCipher` trait provides a standard interface for initializing AEAD ciphers, and for
/// The [`AeadCipher`] trait provides a standard interface for initializing AEAD ciphers, and for
/// performing encryption and decryption operations with additional AAD. This trait is implemented
/// by either the `ChaCha20Poly1305` or `Aes256Gcm` specific cipher types, allowing them to be used
/// interchangeably in cryptographic protocols. It is utilized by the `HandshakeOp` trait to secure
/// the handshake process.
/// by either the [`ChaCha20Poly1305`] or [`Aes256Gcm`] specific cipher types, allowing them to be
/// used interchangeably in cryptographic protocols. It is utilized by the
/// [`crate::handshake::HandshakeOp`] trait to secure the handshake process.
///
/// The `T: Buffer` represents the data buffer to be encrypted or decrypted. The buffer must
/// implement the `Buffer` trait, which provides necessary operations for in-place encryption and
/// implement the [`Buffer`] trait, which provides necessary operations for in-place encryption and
/// decryption.
pub trait AeadCipher {
/// Creates a new instance of the cipher from a 32-byte key.
Expand Down

0 comments on commit 4b7be45

Please sign in to comment.