Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement belt dwp #604

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix belt-dwp tests
makavity committed May 19, 2024
commit a114811d3249ae423879ab36259fd5c1ee23d2c2
6 changes: 3 additions & 3 deletions belt-dwp/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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");
@@ -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");