-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The test used some internal API to test if our zeroization works. We have now switched to the publicly available Ed25519 secret key type. Some additional changes were needed to adjust for the different sizes of the secret key material.
- Loading branch information
Showing
4 changed files
with
18 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ Cargo.lock | |
.gdb_history | ||
/afl/*/target | ||
/afl/*/out* | ||
/contrib/*/target | ||
mutants.out* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
use vodozemac::cipher::key::ExpandedKeys; | ||
use vodozemac::Ed25519SecretKey; | ||
|
||
fn use_keys(_keys: ExpandedKeys) { | ||
fn use_keys(_keys: Ed25519SecretKey) { | ||
println!("Point B. Using keys..."); | ||
} | ||
|
||
fn main() { | ||
// Used for comparison from inside gdb, to ensure the buffer is zeroized. | ||
let _zero: [u8; 80] = [0u8; 80]; | ||
let _zero = [0u8; 32]; | ||
|
||
let secret: [u8; 32] = (0..32).collect::<Vec<_>>().try_into().unwrap(); | ||
let secret = [0xFFu8; 32]; | ||
println!("Point A. Creating keys..."); | ||
let keys = ExpandedKeys::new(&secret); | ||
let keys = Ed25519SecretKey::from_slice(&secret); | ||
use_keys(keys); | ||
println!("Point C. `keys` was dropped so buffer should now be zeroized.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters