summaryrefslogtreecommitdiffstats
path: root/vendor/crypto-common/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/crypto-common/src/lib.rs')
-rw-r--r--vendor/crypto-common/src/lib.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/vendor/crypto-common/src/lib.rs b/vendor/crypto-common/src/lib.rs
index 187b1ac42..c49984cd2 100644
--- a/vendor/crypto-common/src/lib.rs
+++ b/vendor/crypto-common/src/lib.rs
@@ -4,8 +4,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
- html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
- html_root_url = "https://docs.rs/crypto-common/0.1.3"
+ html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
)]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms)]
@@ -26,10 +25,16 @@ use rand_core::{CryptoRng, RngCore};
/// Block on which [`BlockSizeUser`] implementors operate.
pub type Block<B> = GenericArray<u8, <B as BlockSizeUser>::BlockSize>;
+
+/// Parallel blocks on which [`ParBlocksSizeUser`] implementors operate.
+pub type ParBlocks<T> = GenericArray<Block<T>, <T as ParBlocksSizeUser>::ParBlocksSize>;
+
/// Output array of [`OutputSizeUser`] implementors.
pub type Output<T> = GenericArray<u8, <T as OutputSizeUser>::OutputSize>;
+
/// Key used by [`KeySizeUser`] implementors.
pub type Key<B> = GenericArray<u8, <B as KeySizeUser>::KeySize>;
+
/// Initialization vector (nonce) used by [`IvSizeUser`] implementors.
pub type Iv<B> = GenericArray<u8, <B as IvSizeUser>::IvSize>;
@@ -52,6 +57,12 @@ impl<T: BlockSizeUser> BlockSizeUser for &mut T {
type BlockSize = T::BlockSize;
}
+/// Types which can process blocks in parallel.
+pub trait ParBlocksSizeUser: BlockSizeUser {
+ /// Number of blocks which can be processed in parallel.
+ type ParBlocksSize: ArrayLength<Block<Self>>;
+}
+
/// Types which return data with the given size.
pub trait OutputSizeUser {
/// Size of the output in bytes.