1#![no_std]
2#![doc = include_str!("../README.md")]
3#![doc(
4 html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
5 html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
6)]
7#![cfg_attr(docsrs, feature(doc_cfg))]
8#![warn(missing_docs, unreachable_pub)]
9#![cfg_attr(
10 any(
11 sha2_backend = "riscv-zknh",
12 sha2_256_backend = "riscv-zknh",
13 sha2_256_backend = "riscv-zknh",
14 ),
15 feature(riscv_ext_intrinsics)
16)]
17#![allow(clippy::needless_range_loop)]
18
19pub use digest::{self, Digest};
20
21use digest::{
22 block_api::CtOutWrapper,
23 consts::{U28, U32, U48, U64},
24};
25
26pub mod block_api;
28
29#[rustfmt::skip]
30mod consts;
31mod sha256;
32mod sha512;
33
34digest::buffer_fixed!(
35 pub struct Sha256(CtOutWrapper<block_api::Sha256VarCore, U32>);
37 oid: "2.16.840.1.101.3.4.2.1";
38 impl: FixedHashTraits;
39);
40digest::buffer_fixed!(
41 pub struct Sha384(CtOutWrapper<block_api::Sha512VarCore, U48>);
43 oid: "2.16.840.1.101.3.4.2.2";
44 impl: FixedHashTraits;
45);
46digest::buffer_fixed!(
47 pub struct Sha512(CtOutWrapper<block_api::Sha512VarCore, U64>);
49 oid: "2.16.840.1.101.3.4.2.3";
50 impl: FixedHashTraits;
51);
52digest::buffer_fixed!(
53 pub struct Sha224(CtOutWrapper<block_api::Sha256VarCore, U28>);
55 oid: "2.16.840.1.101.3.4.2.4";
56 impl: FixedHashTraits;
57);
58digest::buffer_fixed!(
59 pub struct Sha512_224(CtOutWrapper<block_api::Sha512VarCore, U28>);
61 oid: "2.16.840.1.101.3.4.2.5";
62 impl: FixedHashTraits;
63);
64digest::buffer_fixed!(
65 pub struct Sha512_256(CtOutWrapper<block_api::Sha512VarCore, U32>);
67 oid: "2.16.840.1.101.3.4.2.6";
68 impl: FixedHashTraits;
69);