Skip to content

Commit da485cd

Browse files
authored
Use (Reset)MacTraits (#254)
This PR reverts #250 and #253 since the relevant fix was added to `digest` (see RustCrypto/traits#2341).
1 parent 2c51e3b commit da485cd

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

belt-mac/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ digest::buffer_fixed!(
2020
/// BeltMac instance generic over block cipher.
2121
#[derive(Clone)]
2222
pub struct GenericBeltMac<C: BlockCipherEncrypt + SmallBlockSizeUser>(block_api::BeltMacCore<C>);
23-
impl: BaseFixedTraits MacMarker Reset FixedOutputReset AlgorithmName InnerInit;
23+
impl: ResetMacTraits AlgorithmName InnerInit;
2424
);
2525

2626
/// BeltMac instance.

cbc-mac/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ digest::buffer_fixed!(
2020
/// Generic CBC-MAC instance.
2121
#[derive(Clone)]
2222
pub struct CbcMac<C: BlockCipherEncrypt + SmallBlockSizeUser>(block_api::CbcMacCore<C>);
23-
impl: BaseFixedTraits MacMarker Reset FixedOutputReset InnerInit;
23+
impl: ResetMacTraits InnerInit;
2424
);
2525

2626
impl<C> AlgorithmName for CbcMac<C>

cmac/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ digest::buffer_fixed!(
2121
/// Generic CMAC instance.
2222
#[derive(Clone)]
2323
pub struct Cmac<C: CmacCipher>(block_api::CmacCore<C>);
24-
impl: BaseFixedTraits MacMarker Reset FixedOutputReset InnerInit;
24+
impl: ResetMacTraits InnerInit;
2525
);
2626

2727
impl<C: CmacCipher + AlgorithmName> AlgorithmName for Cmac<C> {

hmac/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ digest::buffer_fixed!(
3737
/// Generic HMAC instance.
3838
#[derive(Clone)]
3939
pub struct Hmac<D: EagerHash>(block_api::HmacCore<D>);
40-
impl: BaseFixedTraits MacMarker KeyInit;
40+
impl: MacTraits KeyInit;
4141
);
4242

4343
impl<D: EagerHash + AlgorithmName> AlgorithmName for Hmac<D> {
@@ -50,7 +50,7 @@ digest::buffer_fixed!(
5050
/// Generic HMAC instance with reset support.
5151
#[derive(Clone)]
5252
pub struct HmacReset<D: EagerHash>(block_api::HmacResetCore<D>);
53-
impl: BaseFixedTraits MacMarker Reset FixedOutputReset KeyInit;
53+
impl: ResetMacTraits KeyInit;
5454
);
5555

5656
impl<D: EagerHash + AlgorithmName> AlgorithmName for HmacReset<D> {

pmac/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ digest::buffer_fixed!(
2121
/// Generic PMAC instance with `LC_SIZE` = 20.
2222
#[derive(Clone)]
2323
pub struct Pmac<C: PmacCipher>(block_api::PmacCore<C, 20>);
24-
impl: BaseFixedTraits MacMarker Reset FixedOutputReset InnerInit;
24+
impl: ResetMacTraits InnerInit;
2525
);
2626

2727
impl<C: PmacCipher + AlgorithmName> AlgorithmName for Pmac<C> {

retail-mac/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ use digest::{
2626

2727
digest::buffer_fixed!(
2828
/// Generic Retail MAC instance.
29-
pub struct RetailMac<C: BlockCipherEncrypt + BlockCipherDecrypt + SmallBlockSizeUser >(RetailMacCore<C>);
30-
impl: BaseFixedTraits MacMarker Reset FixedOutputReset;
29+
#[derive(Clone)]
30+
pub struct RetailMac<C: BlockCipherEncrypt + BlockCipherDecrypt + SmallBlockSizeUser>(RetailMacCore<C>);
31+
impl: ResetMacTraits;
3132
);
3233

3334
impl<C> KeySizeUser for RetailMac<C>

0 commit comments

Comments
 (0)