Skip to content

Commit

Permalink
removed doc comments with general comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Shourya742 authored and rrybarczyk committed Oct 14, 2024
1 parent a3b4369 commit ba3dbdd
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions protocols/v2/noise-sv2/src/cipher_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ use crate::aed_cipher::AeadCipher;
use aes_gcm::Aes256Gcm;
use chacha20poly1305::{aead::Buffer, ChaCha20Poly1305};

/// The `CipherState` trait manages AEAD ciphers for secure communication, handling the encryption key, nonce,
/// and cipher instance. It supports encryption and decryption with ciphers like [`ChaCha20Poly1305`] and
/// [`Aes256Gcm`], ensuring proper key and nonce management.
///
/// Key responsibilities:
/// - **Key management**: Set and retrieve the 32-byte encryption key.
/// - **Nonce management**: Track unique nonces for encryption operations.
/// - **Cipher handling**: Initialize and manage AEAD ciphers for secure data encryption.
///
/// Used in protocols like Noise, `CipherState` ensures secure communication by managing cryptographic material
/// during and after handshakes.
// The `CipherState` trait manages AEAD ciphers for secure communication, handling the encryption key, nonce,
// and cipher instance. It supports encryption and decryption with ciphers like [`ChaCha20Poly1305`] and
// [`Aes256Gcm`], ensuring proper key and nonce management.
//
// Key responsibilities:
// - **Key management**: Set and retrieve the 32-byte encryption key.
// - **Nonce management**: Track unique nonces for encryption operations.
// - **Cipher handling**: Initialize and manage AEAD ciphers for secure data encryption.
//
// Used in protocols like Noise, `CipherState` ensures secure communication by managing cryptographic material
// during and after handshakes.
pub trait CipherState<Cipher_: AeadCipher>
where
Self: Sized,
Expand Down Expand Up @@ -162,15 +162,15 @@ where
}
}

/// The `GenericCipher` enum abstracts the use of two AEAD ciphers: [`ChaCha20Poly1305`] and [`Aes256Gcm`].
/// It provides a unified interface for secure encryption and decryption, allowing flexibility in choosing
/// the cipher while ensuring consistent cryptographic operations.
///
/// Variants:
/// - **ChaCha20Poly1305**: Uses the `ChaCha20Poly1305` cipher for encryption.
/// - **Aes256Gcm**: Uses the `Aes256Gcm` cipher for encryption.
///
/// `GenericCipher` enables easy switching between ciphers while maintaining secure key and nonce management.
// The `GenericCipher` enum abstracts the use of two AEAD ciphers: [`ChaCha20Poly1305`] and [`Aes256Gcm`].
// It provides a unified interface for secure encryption and decryption, allowing flexibility in choosing
// the cipher while ensuring consistent cryptographic operations.
//
// Variants:
// - **ChaCha20Poly1305**: Uses the `ChaCha20Poly1305` cipher for encryption.
// - **Aes256Gcm**: Uses the `Aes256Gcm` cipher for encryption.
//
// `GenericCipher` enables easy switching between ciphers while maintaining secure key and nonce management.
#[allow(clippy::large_enum_variant)]
pub enum GenericCipher {
ChaCha20Poly1305(Cipher<ChaCha20Poly1305>),
Expand Down

0 comments on commit ba3dbdd

Please sign in to comment.