diff --git a/Cargo.lock b/Cargo.lock index ac9536a6..8768221e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -220,7 +220,7 @@ name = "cipher" version = "0.5.0-pre.6" dependencies = [ "blobby", - "crypto-common 0.2.0-rc.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crypto-common 0.2.0-rc.0", "inout 0.2.0-rc.0", "zeroize", ] diff --git a/cipher/Cargo.toml b/cipher/Cargo.toml index fb2536eb..d677c951 100644 --- a/cipher/Cargo.toml +++ b/cipher/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["crypto", "block-cipher", "stream-cipher", "trait"] categories = ["cryptography", "no-std"] [dependencies] -crypto-common = "0.2.0-rc.0" +crypto-common = { path = "../crypto-common/", version = "0.2.0-rc.0" } inout = "0.2.0-rc.0" # optional dependencies diff --git a/cipher/src/lib.rs b/cipher/src/lib.rs index 032e05da..d9d4fa1e 100644 --- a/cipher/src/lib.rs +++ b/cipher/src/lib.rs @@ -42,13 +42,7 @@ pub mod stream; pub use crypto_common::{ array, typenum::{self, consts}, - AlgorithmName, Block, BlockSizeUser, InnerIvInit, InvalidLength, Iv, IvSizeUser, Key, KeyInit, - KeyIvInit, KeySizeUser, ParBlocks, ParBlocksSizeUser, + AlgorithmName, Block, BlockSizeUser, InnerIvInit, InvalidLength, Iv, IvSizeUser, IvState, Key, + KeyInit, KeyIvInit, KeySizeUser, ParBlocks, ParBlocksSizeUser, }; pub use inout::{InOut, InOutBuf}; - -/// Trait for loading current IV state. -pub trait IvState: IvSizeUser { - /// Returns current IV state. - fn iv_state(&self) -> Iv; -} diff --git a/crypto-common/src/lib.rs b/crypto-common/src/lib.rs index 712fcf49..bd62fade 100644 --- a/crypto-common/src/lib.rs +++ b/crypto-common/src/lib.rs @@ -305,6 +305,12 @@ pub trait InnerIvInit: InnerUser + IvSizeUser + Sized { } } +/// Trait for loading current IV state. +pub trait IvState: IvSizeUser { + /// Returns current IV state. + fn iv_state(&self) -> Iv; +} + impl KeySizeUser for T where T: InnerUser,