| 1 | //! This crate defines a set of traits which describe the functionality of |
| 2 | //! [block ciphers][1], [block modes][2], and [stream ciphers][3]. |
| 3 | //! |
| 4 | //! [1]: https://en.wikipedia.org/wiki/Block_cipher |
| 5 | //! [2]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation |
| 6 | //! [3]: https://en.wikipedia.org/wiki/Stream_cipher |
| 7 | |
| 8 | #![no_std ] |
| 9 | #![cfg_attr (docsrs, feature(doc_cfg))] |
| 10 | #![doc ( |
| 11 | html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg" , |
| 12 | html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg" |
| 13 | )] |
| 14 | #![warn (missing_docs, rust_2018_idioms)] |
| 15 | |
| 16 | pub use crypto_common; |
| 17 | pub use inout; |
| 18 | |
| 19 | #[cfg (all(feature = "block-padding" , feature = "alloc" ))] |
| 20 | extern crate alloc; |
| 21 | |
| 22 | #[cfg (feature = "std" )] |
| 23 | extern crate std; |
| 24 | |
| 25 | #[cfg (feature = "rand_core" )] |
| 26 | #[cfg_attr (docsrs, doc(cfg(feature = "rand_core" )))] |
| 27 | pub use crypto_common::rand_core; |
| 28 | |
| 29 | #[cfg (feature = "block-padding" )] |
| 30 | #[cfg_attr (docsrs, doc(cfg(feature = "block-padding" )))] |
| 31 | pub use inout::block_padding; |
| 32 | |
| 33 | #[cfg (feature = "zeroize" )] |
| 34 | #[cfg_attr (docsrs, doc(cfg(feature = "zeroize" )))] |
| 35 | pub use zeroize; |
| 36 | |
| 37 | #[cfg (feature = "dev" )] |
| 38 | pub use blobby; |
| 39 | |
| 40 | mod block; |
| 41 | #[cfg (feature = "dev" )] |
| 42 | mod dev; |
| 43 | mod errors; |
| 44 | mod stream; |
| 45 | mod stream_core; |
| 46 | mod stream_wrapper; |
| 47 | |
| 48 | pub use crate::{block::*, errors::*, stream::*, stream_core::*, stream_wrapper::*}; |
| 49 | pub use crypto_common::{ |
| 50 | generic_array, |
| 51 | typenum::{self, consts}, |
| 52 | AlgorithmName, Block, InnerIvInit, InvalidLength, Iv, IvSizeUser, Key, KeyInit, KeyIvInit, |
| 53 | KeySizeUser, ParBlocks, ParBlocksSizeUser, |
| 54 | }; |
| 55 | |
| 56 | /// Trait for loading current IV state. |
| 57 | pub trait IvState: IvSizeUser { |
| 58 | /// Returns current IV state. |
| 59 | fn iv_state(&self) -> Iv<Self>; |
| 60 | } |
| 61 | |