chore: Move hashing functions into sodium/ciphers crate

This finishes the last step of removing sodium.rs from the rosenpass crate
itself and also removes the NOTHING and NONCE0 constants.

Hashing functions now use destination parameters;
rosenpass_constant_time::xor now does too.
This commit is contained in:
Karolin Varner
2023-11-28 15:06:27 +01:00
committed by Karolin Varner
parent d44793e07f
commit 09aa0e027e
21 changed files with 203 additions and 202 deletions

View File

@@ -21,6 +21,9 @@ path = "../sodium"
[dependencies.rosenpass-ciphers]
path = "../ciphers"
[dependencies.rosenpass-to]
path = "../to"
[[bin]]
name = "fuzz_handle_msg"
path = "fuzz_targets/handle_msg.rs"

View File

@@ -4,8 +4,8 @@ extern crate rosenpass;
use libfuzzer_sys::fuzz_target;
use rosenpass::sodium::mac_into;
use rosenpass_sodium::init as sodium_init;
use rosenpass_sodium::{hash::blake2b, init as sodium_init};
use rosenpass_to::To;
#[derive(arbitrary::Arbitrary, Debug)]
pub struct Blake2b {
@@ -18,5 +18,5 @@ fuzz_target!(|input: Blake2b| {
let mut out = [0u8; 32];
mac_into(&mut out, &input.key, &input.data).unwrap();
blake2b::hash(&input.key, &input.data).to(&mut out).unwrap();
});