modulate the sha512 target based on the host configuration

xous targets use the Precursor hardware engine for hashing

all others use a software-only implementation. Not the most
performant but the code is vendored in
directly from the rustcrypto crate.
This commit is contained in:
bunnie 2024-01-05 16:17:59 +08:00
parent 2addc83f76
commit 4d850bffbc
2 changed files with 7 additions and 1 deletions

View file

@ -1,4 +1,5 @@
pub(crate) const SERVER_NAME_SHA512: &str = "_Sha512 hardware accelerator server_";
#[allow(dead_code)]
pub(crate) const SERVER_NAME_SHA512: &str = "_Sha512 hardware accelerator server_"; // not used in hosted config
mod rkyv_enum;
pub use rkyv_enum::*;

View file

@ -5,7 +5,12 @@ pub use api::*;
mod consts;
mod sha256;
#[cfg(target_os = "xous")]
mod sha512;
#[cfg(not(target_os = "xous"))]
mod sha512_hosted;
#[cfg(not(target_os = "xous"))]
use sha512_hosted as sha512;
pub use digest::{self, Digest};
pub use sha256::{Sha224, Sha256};