1- use belt_block:: BeltBlock ;
21use cipher:: { BlockCipherEncBackend , BlockCipherEncClosure , BlockCipherEncrypt } ;
32use core:: fmt;
43use digest:: {
@@ -17,9 +16,9 @@ use digest::zeroize::{Zeroize, ZeroizeOnDrop};
1716
1817/// Generic core BeltMac instance, which operates over blocks.
1918#[ derive( Clone ) ]
20- pub struct BeltMacCore < C = BeltBlock >
19+ pub struct BeltMacCore < C >
2120where
22- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
21+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
2322{
2423 cipher : C ,
2524 state : Block < C > ,
@@ -28,30 +27,30 @@ where
2827
2928impl < C > BlockSizeUser for BeltMacCore < C >
3029where
31- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
30+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
3231{
3332 type BlockSize = C :: BlockSize ;
3433}
3534
3635impl < C > OutputSizeUser for BeltMacCore < C >
3736where
38- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
37+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
3938{
4039 type OutputSize = C :: BlockSize ;
4140}
4241
4342impl < C > InnerUser for BeltMacCore < C >
4443where
45- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
44+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
4645{
4746 type Inner = C ;
4847}
4948
50- impl < C > MacMarker for BeltMacCore < C > where C : BlockCipherEncrypt + SmallBlockSizeUser + Clone { }
49+ impl < C > MacMarker for BeltMacCore < C > where C : BlockCipherEncrypt + SmallBlockSizeUser { }
5150
5251impl < C > InnerInit for BeltMacCore < C >
5352where
54- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
53+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
5554{
5655 #[ inline]
5756 fn inner_init ( cipher : C ) -> Self {
@@ -64,14 +63,14 @@ where
6463
6564impl < C > BufferKindUser for BeltMacCore < C >
6665where
67- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
66+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
6867{
6968 type BufferKind = Lazy ;
7069}
7170
7271impl < C > UpdateCore for BeltMacCore < C >
7372where
74- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
73+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
7574{
7675 #[ inline]
7776 fn update_blocks ( & mut self , blocks : & [ Block < Self > ] ) {
@@ -101,7 +100,7 @@ where
101100
102101impl < C > Reset for BeltMacCore < C >
103102where
104- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
103+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
105104{
106105 #[ inline( always) ]
107106 fn reset ( & mut self ) {
@@ -111,7 +110,7 @@ where
111110
112111impl < C > FixedOutputCore for BeltMacCore < C >
113112where
114- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
113+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
115114{
116115 #[ inline]
117116 fn finalize_fixed_core ( & mut self , buffer : & mut Buffer < Self > , out : & mut Output < Self > ) {
@@ -148,7 +147,7 @@ where
148147
149148impl < C > AlgorithmName for BeltMacCore < C >
150149where
151- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
150+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
152151{
153152 fn write_alg_name ( f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
154153 f. write_str ( "BeltMac" )
@@ -157,7 +156,7 @@ where
157156
158157impl < C > fmt:: Debug for BeltMacCore < C >
159158where
160- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
159+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
161160{
162161 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
163162 f. write_str ( "BeltMacCore { ... }" )
@@ -167,7 +166,7 @@ where
167166#[ cfg( feature = "zeroize" ) ]
168167impl < C > Drop for BeltMacCore < C >
169168where
170- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone ,
169+ C : BlockCipherEncrypt + SmallBlockSizeUser ,
171170{
172171 fn drop ( & mut self ) {
173172 self . state . zeroize ( ) ;
@@ -176,7 +175,7 @@ where
176175
177176#[ cfg( feature = "zeroize" ) ]
178177impl < C > ZeroizeOnDrop for BeltMacCore < C > where
179- C : BlockCipherEncrypt + SmallBlockSizeUser + Clone + ZeroizeOnDrop
178+ C : BlockCipherEncrypt + SmallBlockSizeUser + ZeroizeOnDrop
180179{
181180}
182181
0 commit comments