Skip to main content

ripemd/
lib.rs

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#![forbid(unsafe_code)]
9#![warn(missing_docs, unreachable_pub)]
10
11pub use digest::{self, Digest};
12
13/// Block-level types
14pub mod block_api;
15mod c128;
16mod c160;
17mod c256;
18mod c320;
19
20// Note about used OIDs: there are two OIDs defined for RIPEMD-128/160.
21// The Teletrust one (which is used by almost anybody, including BouncyCastle,
22// OpenSSL, GnuTLS, etc.) and the ISO one (1.0.10118.3.0.50/49), which appears
23// to be used only by the Go standard library.
24
25digest::buffer_fixed!(
26    /// RIPEMD-128 hasher
27    pub struct Ripemd128(block_api::Ripemd128Core);
28    oid: "1.3.36.3.2.2";
29    impl: FixedHashTraits;
30);
31digest::buffer_fixed!(
32    /// RIPEMD-160 hasher
33    pub struct Ripemd160(block_api::Ripemd160Core);
34    oid: "1.3.36.3.2.1";
35    impl: FixedHashTraits;
36);
37digest::buffer_fixed!(
38    /// RIPEMD-256 hasher
39    pub struct Ripemd256(block_api::Ripemd256Core);
40    oid: "1.3.36.3.2.3";
41    impl: FixedHashTraits;
42);
43digest::buffer_fixed!(
44    /// RIPEMD-320 hasher
45    pub struct Ripemd320(block_api::Ripemd320Core);
46    impl: FixedHashTraits;
47);