symbol_crypto_core/
lib.rs

1// Copyright 2021 BlockPuppets developers.
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9#![warn(
10    missing_debug_implementations,
11    missing_docs,
12    rust_2018_idioms,
13    unreachable_pub
14)]
15#![deny(broken_intra_doc_links)]
16#![doc(test(
17    no_crate_inject,
18    attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
19))]
20
21//! # Complete Symbol & Nis1 blockchain crypto library implementation.
22//!
23//! ## Quickstart: `prelude`
24//!
25//! A prelude is provided which imports all the important data types and traits for you. Use this
26//! when you want to quickly bootstrap a new project.
27//!
28//! ```no_run
29//! # #[allow(unused)]
30//! use symbol_crypto_core::prelude::*;
31//! ```
32//!
33//! Examples on how you can use the types imported by the prelude can be found in
34//! the [`examples` directory of the repository](https://github.com/BlockPuppets/symbol-crypto-core/tree/master/examples)
35//! and in the `tests/` directories of each crate.
36//!
37//! # Quick explanation of each module in ascending order of abstraction
38//!
39//! ## `core`
40//!
41//! Contains all the [necessary data structures] what Symbol & Nis1 have in common.
42//!
43//! ## `crypto-sym`
44//!
45//! Symbol Bockchain crypto library, along with cryptographic utilities for signing and
46//! verifying Edwards Digital Signature Algorithm (EdDSA) over Curve25519.
47//!
48//! ## `crypto-nis1`
49//!
50//! Nis1 Bockchain crypto library, along with cryptographic utilities for signing and
51//! verifying Edwards Digital Signature Algorithm (EdDSA) over Curve25519.
52//!
53
54#[cfg(feature = "nis1")]
55pub use nis1_crypto as nis1;
56pub use sym_crypto as sym;
57
58/// Easy imports of frequently used type definitions and traits
59///
60#[doc(hidden)]
61pub mod prelude {
62    pub use core_crypto::*;
63
64    #[cfg(feature = "nis1")]
65    pub use nis1_crypto::CryptoNis1;
66    #[cfg(feature = "nis1")]
67    pub type KpNis1 = nis1_crypto::keypair::Keypair;
68
69    pub use sym_crypto::CryptoSym;
70    pub type KpSym = sym_crypto::keypair::Keypair;
71}