@@ -5,8 +5,6 @@ use super::{
55#[ cfg( feature = "mac" ) ]
66use crate :: MacMarker ;
77use crate :: { CustomizedInit , HashMarker , VarOutputCustomized } ;
8- #[ cfg( feature = "oid" ) ]
9- use const_oid:: { AssociatedOid , ObjectIdentifier } ;
108use core:: {
119 fmt,
1210 marker:: PhantomData ,
@@ -18,26 +16,20 @@ use crypto_common::{
1816 hazmat:: { DeserializeStateError , SerializableState , SerializedState , SubSerializedStateSize } ,
1917 typenum:: { IsLess , IsLessOrEqual , Le , LeEq , NonZero , Sum , U1 , U256 } ,
2018} ;
21-
22- /// Dummy type used with [`CtVariableCoreWrapper`] in cases when
23- /// resulting hash does not have a known OID.
24- #[ derive( Copy , Clone , Debug , Eq , PartialEq , Hash ) ]
25- pub struct NoOid ;
26-
2719/// Wrapper around [`VariableOutputCore`] which selects output size
2820/// at compile time.
2921#[ derive( Clone ) ]
30- pub struct CtVariableCoreWrapper < T , OutSize , O = NoOid >
22+ pub struct CtVariableCoreWrapper < T , OutSize >
3123where
3224 T : VariableOutputCore ,
3325 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
3426 LeEq < OutSize , T :: OutputSize > : NonZero ,
3527{
3628 inner : T ,
37- _out : PhantomData < ( OutSize , O ) > ,
29+ _out : PhantomData < OutSize > ,
3830}
3931
40- impl < T , OutSize , O > HashMarker for CtVariableCoreWrapper < T , OutSize , O >
32+ impl < T , OutSize > HashMarker for CtVariableCoreWrapper < T , OutSize >
4133where
4234 T : VariableOutputCore + HashMarker ,
4335 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -46,15 +38,15 @@ where
4638}
4739
4840#[ cfg( feature = "mac" ) ]
49- impl < T , OutSize , O > MacMarker for CtVariableCoreWrapper < T , OutSize , O >
41+ impl < T , OutSize > MacMarker for CtVariableCoreWrapper < T , OutSize >
5042where
5143 T : VariableOutputCore + MacMarker ,
5244 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
5345 LeEq < OutSize , T :: OutputSize > : NonZero ,
5446{
5547}
5648
57- impl < T , OutSize , O > BlockSizeUser for CtVariableCoreWrapper < T , OutSize , O >
49+ impl < T , OutSize > BlockSizeUser for CtVariableCoreWrapper < T , OutSize >
5850where
5951 T : VariableOutputCore ,
6052 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
6355 type BlockSize = T :: BlockSize ;
6456}
6557
66- impl < T , OutSize , O > UpdateCore for CtVariableCoreWrapper < T , OutSize , O >
58+ impl < T , OutSize > UpdateCore for CtVariableCoreWrapper < T , OutSize >
6759where
6860 T : VariableOutputCore ,
6961 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
7567 }
7668}
7769
78- impl < T , OutSize , O > OutputSizeUser for CtVariableCoreWrapper < T , OutSize , O >
70+ impl < T , OutSize > OutputSizeUser for CtVariableCoreWrapper < T , OutSize >
7971where
8072 T : VariableOutputCore ,
8173 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
8476 type OutputSize = OutSize ;
8577}
8678
87- impl < T , OutSize , O > BufferKindUser for CtVariableCoreWrapper < T , OutSize , O >
79+ impl < T , OutSize > BufferKindUser for CtVariableCoreWrapper < T , OutSize >
8880where
8981 T : VariableOutputCore ,
9082 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
9385 type BufferKind = T :: BufferKind ;
9486}
9587
96- impl < T , OutSize , O > FixedOutputCore for CtVariableCoreWrapper < T , OutSize , O >
88+ impl < T , OutSize > FixedOutputCore for CtVariableCoreWrapper < T , OutSize >
9789where
9890 T : VariableOutputCore ,
9991 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -116,7 +108,7 @@ where
116108 }
117109}
118110
119- impl < T , OutSize , O > Default for CtVariableCoreWrapper < T , OutSize , O >
111+ impl < T , OutSize > Default for CtVariableCoreWrapper < T , OutSize >
120112where
121113 T : VariableOutputCore ,
122114 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -131,7 +123,7 @@ where
131123 }
132124}
133125
134- impl < T , OutSize , O > CustomizedInit for CtVariableCoreWrapper < T , OutSize , O >
126+ impl < T , OutSize > CustomizedInit for CtVariableCoreWrapper < T , OutSize >
135127where
136128 T : VariableOutputCore + VarOutputCustomized ,
137129 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -146,7 +138,7 @@ where
146138 }
147139}
148140
149- impl < T , OutSize , O > Reset for CtVariableCoreWrapper < T , OutSize , O >
141+ impl < T , OutSize > Reset for CtVariableCoreWrapper < T , OutSize >
150142where
151143 T : VariableOutputCore ,
152144 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -158,7 +150,7 @@ where
158150 }
159151}
160152
161- impl < T , OutSize , O > AlgorithmName for CtVariableCoreWrapper < T , OutSize , O >
153+ impl < T , OutSize > AlgorithmName for CtVariableCoreWrapper < T , OutSize >
162154where
163155 T : VariableOutputCore + AlgorithmName ,
164156 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -171,27 +163,16 @@ where
171163 }
172164}
173165
174- #[ cfg( feature = "oid" ) ]
175- impl < T , OutSize , O > AssociatedOid for CtVariableCoreWrapper < T , OutSize , O >
176- where
177- T : VariableOutputCore ,
178- O : AssociatedOid ,
179- OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
180- LeEq < OutSize , T :: OutputSize > : NonZero ,
181- {
182- const OID : ObjectIdentifier = O :: OID ;
183- }
184-
185166#[ cfg( feature = "zeroize" ) ]
186- impl < T , OutSize , O > zeroize:: ZeroizeOnDrop for CtVariableCoreWrapper < T , OutSize , O >
167+ impl < T , OutSize > zeroize:: ZeroizeOnDrop for CtVariableCoreWrapper < T , OutSize >
187168where
188169 T : VariableOutputCore + zeroize:: ZeroizeOnDrop ,
189170 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
190171 LeEq < OutSize , T :: OutputSize > : NonZero ,
191172{
192173}
193174
194- impl < T , OutSize , O > fmt:: Debug for CtVariableCoreWrapper < T , OutSize , O >
175+ impl < T , OutSize > fmt:: Debug for CtVariableCoreWrapper < T , OutSize >
195176where
196177 T : VariableOutputCore + AlgorithmName ,
197178 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -202,26 +183,10 @@ where
202183 }
203184}
204185
205- /// Implement dummy type with hidden docs which is used to "carry" hasher
206- /// OID for [`CtVariableCoreWrapper`].
207- #[ macro_export]
208- macro_rules! impl_oid_carrier {
209- ( $name: ident, $oid: literal) => {
210- #[ doc( hidden) ]
211- #[ derive( Copy , Clone , Debug , Eq , PartialEq , Hash ) ]
212- pub struct $name;
213-
214- #[ cfg( feature = "oid" ) ]
215- impl AssociatedOid for $name {
216- const OID : ObjectIdentifier = ObjectIdentifier :: new_unwrap( $oid) ;
217- }
218- } ;
219- }
220-
221186type CtVariableCoreWrapperSerializedStateSize < T > =
222187 Sum < <T as SerializableState >:: SerializedStateSize , U1 > ;
223188
224- impl < T , OutSize , O > SerializableState for CtVariableCoreWrapper < T , OutSize , O >
189+ impl < T , OutSize > SerializableState for CtVariableCoreWrapper < T , OutSize >
225190where
226191 T : VariableOutputCore + SerializableState ,
227192 OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
0 commit comments