hashable-integrable-macro #99

Open
CleverWild wants to merge 4 commits from hashable-integrable-macro into main
3 changed files with 8 additions and 4 deletions
Showing only changes of commit 647f0c8519 - Show all commits

View File

@@ -0,0 +1,6 @@
use crate::hashing::Hashable;
pub trait Integrable: Hashable {
const KIND: &'static str;
const VERSION: i32 = 1;
}

View File

@@ -1,6 +1,7 @@
#[cfg(feature = "authn")]
pub mod authn;
pub mod hashing;
pub mod integrity;
#[cfg(feature = "safecell")]
pub mod safecell;

View File

@@ -52,10 +52,7 @@ pub const INTEGRITY_SUBKEY_TAG: &[u8] = b"arbiter/db-integrity-key/v1";
pub type HmacSha256 = Hmac<Sha256>;
pub trait Integrable: Hashable {
const KIND: &'static str;
const VERSION: i32 = 1;
}
pub use arbiter_crypto::integrity::Integrable;
fn payload_hash(payload: &impl Hashable) -> [u8; 32] {
let mut hasher = Sha256::new();