Skip to content

Commit

Permalink
fix belt-dwp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
makavity committed May 19, 2024
1 parent 34e07d6 commit a114811
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions belt-dwp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
//! BeltDwp, Nonce
//! };
//!
//! let key = BeltDwp::generate_key()?;
//! let key = BeltDwp::generate_key(&mut OsRng);
//! let cipher = BeltDwp::new(&key);
//! let nonce = BeltDwp::generate_nonce()?; // 96-bits; unique per message
//! let nonce = BeltDwp::generate_nonce(&mut OsRng); // 128-bits; unique per message
//! let ciphertext = cipher.encrypt(&nonce, b"plaintext message".as_ref())?;
//! let plaintext = cipher.decrypt(&nonce, ciphertext.as_ref())?;
//! assert_eq!(&plaintext, b"plaintext message");
Expand Down Expand Up @@ -60,7 +60,7 @@
//!
//! let key = BeltDwp::generate_key()?;
//! let cipher = BeltDwp::new(&key);
//! let nonce = Nonce::from_slice(b"unique nonce"); // 96-bits; unique per message
//! let nonce = Nonce::from_slice(b"unique nonce1234"); // 128-bits; unique per message
//!
//! let mut buffer: Vec<u8, 128> = Vec::new(); // Note: buffer needs 16-bytes overhead for auth tag
//! buffer.extend_from_slice(b"plaintext message");
Expand Down

0 comments on commit a114811

Please sign in to comment.