Skip to content

Commit

Permalink
Move IvState to crypto-common
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Aug 2, 2024
1 parent 0515b56 commit 01deeb3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cipher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 2 additions & 8 deletions cipher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self>;
}
6 changes: 6 additions & 0 deletions crypto-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self>;
}

impl<T> KeySizeUser for T
where
T: InnerUser,
Expand Down

0 comments on commit 01deeb3

Please sign in to comment.