hopr_crypto_types/
lib.rs

1//! This Rust crate contains implementation of common cryptographic types.
2
3/// Contains error enum implementation used across other `hopr-crypto-...` crates
4pub mod errors;
5/// Implements [ChainKeypair](keypairs::ChainKeypair) and [OffchainKeypair](keypairs::OffchainKeypair),
6/// the important representations of chain key and packet key.
7pub mod keypairs;
8/// Re-exports of low-level cryptographic primitives.
9pub mod primitives;
10/// Enables randomized encryption (sealing)
11/// and decryption of data using [`OffchainKeypair`](keypairs::OffchainKeypair).
12pub mod seal;
13/// Implements basic cryptography-related types based on [primitives], such as [Hash](types::Hash),
14/// [PublicKey](types::PublicKey) and [Signature](types::Signature).
15pub mod types;
16/// Contains small utility functions used in the other `hopr-crypto-...` crates
17pub mod utils;
18/// Contains implementation of Verifiable Random Function used in tickets
19pub mod vrf;
20
21/// Re-exports from the generic cryptographic traits.
22pub mod crypto_traits {
23    pub use cipher::{
24        BlockSizeUser, Iv, IvSizeUser, Key, KeyInit, KeyIvInit, KeySizeUser, StreamCipher, StreamCipherSeek,
25    };
26    pub use digest::{Digest, FixedOutput, FixedOutputReset, Output, OutputSizeUser, Update};
27    pub use hopr_crypto_random::Randomizable;
28    pub use poly1305::universal_hash::UniversalHash;
29}
30
31#[doc(hidden)]
32pub mod prelude {
33    pub use libp2p_identity::PeerId;
34
35    pub use super::{
36        crypto_traits, errors::CryptoError, keypairs::*, primitives::*, seal::*, types::*, utils::*, vrf::*,
37    };
38}