Skip to content

Commit

Permalink
mgm: remove unnecessary NewBlockCipher bounds (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov authored May 20, 2021
1 parent 99bf36c commit 7d690bd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions mgm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.4.1 (2021-05-20)
### Changed
- Remove unnecessary `NewBlockCipher` bounds ([#314])

[#314]: https://github.com/RustCrypto/AEADs/pull/314

## 0.4.0 (2021-04-29)
### Changed
- Bump `aead` dependency to v0.4.0 release ([#270])
Expand Down
2 changes: 1 addition & 1 deletion mgm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mgm"
version = "0.4.0"
version = "0.4.1"
description = "Generic implementation of the Multilinear Galois Mode (MGM) cipher"
authors = ["RustCrypto Developers"]
edition = "2018"
Expand Down
12 changes: 6 additions & 6 deletions mgm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ const ONE: Wrapping<u64> = Wrapping(1);
#[derive(Clone)]
pub struct Mgm<C>
where
C: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher,
C: BlockCipher<BlockSize = U16> + BlockEncrypt,
C::ParBlocks: ArrayLength<Block>,
{
cipher: C,
}

impl<C> Mgm<C>
where
C: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher,
C: BlockCipher<BlockSize = U16> + BlockEncrypt,
C::ParBlocks: ArrayLength<Block>,
{
fn get_h(&self, counter: &Counter) -> Block {
Expand All @@ -86,7 +86,7 @@ where

impl<C> From<C> for Mgm<C>
where
C: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher,
C: BlockCipher<BlockSize = U16> + BlockEncrypt,
C::ParBlocks: ArrayLength<Block>,
{
fn from(cipher: C) -> Self {
Expand All @@ -108,7 +108,7 @@ where

impl<C> AeadCore for Mgm<C>
where
C: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher,
C: BlockCipher<BlockSize = U16> + BlockEncrypt,
C::ParBlocks: ArrayLength<Block>,
{
type NonceSize = C::BlockSize;
Expand All @@ -118,7 +118,7 @@ where

impl<C> AeadInPlace for Mgm<C>
where
C: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher,
C: BlockCipher<BlockSize = U16> + BlockEncrypt,
C::ParBlocks: ArrayLength<Block>,
{
fn encrypt_in_place_detached(
Expand Down Expand Up @@ -293,7 +293,7 @@ fn to_bytes(v: &Counter) -> Block {

impl<C> fmt::Debug for Mgm<C>
where
C: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + fmt::Debug,
C: BlockCipher<BlockSize = U16> + BlockEncrypt + fmt::Debug,
C::ParBlocks: ArrayLength<Block>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
Expand Down

0 comments on commit 7d690bd

Please sign in to comment.