@@ -5,8 +5,6 @@ use super::{
5
5
#[ cfg( feature = "mac" ) ]
6
6
use crate :: MacMarker ;
7
7
use crate :: { CustomizedInit , HashMarker , VarOutputCustomized } ;
8
- #[ cfg( feature = "oid" ) ]
9
- use const_oid:: { AssociatedOid , ObjectIdentifier } ;
10
8
use core:: {
11
9
fmt,
12
10
marker:: PhantomData ,
@@ -18,26 +16,20 @@ use crypto_common::{
18
16
hazmat:: { DeserializeStateError , SerializableState , SerializedState , SubSerializedStateSize } ,
19
17
typenum:: { IsLess , IsLessOrEqual , Le , LeEq , NonZero , Sum , U1 , U256 } ,
20
18
} ;
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
-
27
19
/// Wrapper around [`VariableOutputCore`] which selects output size
28
20
/// at compile time.
29
21
#[ derive( Clone ) ]
30
- pub struct CtVariableCoreWrapper < T , OutSize , O = NoOid >
22
+ pub struct CtVariableCoreWrapper < T , OutSize >
31
23
where
32
24
T : VariableOutputCore ,
33
25
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
34
26
LeEq < OutSize , T :: OutputSize > : NonZero ,
35
27
{
36
28
inner : T ,
37
- _out : PhantomData < ( OutSize , O ) > ,
29
+ _out : PhantomData < OutSize > ,
38
30
}
39
31
40
- impl < T , OutSize , O > HashMarker for CtVariableCoreWrapper < T , OutSize , O >
32
+ impl < T , OutSize > HashMarker for CtVariableCoreWrapper < T , OutSize >
41
33
where
42
34
T : VariableOutputCore + HashMarker ,
43
35
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -46,15 +38,15 @@ where
46
38
}
47
39
48
40
#[ cfg( feature = "mac" ) ]
49
- impl < T , OutSize , O > MacMarker for CtVariableCoreWrapper < T , OutSize , O >
41
+ impl < T , OutSize > MacMarker for CtVariableCoreWrapper < T , OutSize >
50
42
where
51
43
T : VariableOutputCore + MacMarker ,
52
44
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
53
45
LeEq < OutSize , T :: OutputSize > : NonZero ,
54
46
{
55
47
}
56
48
57
- impl < T , OutSize , O > BlockSizeUser for CtVariableCoreWrapper < T , OutSize , O >
49
+ impl < T , OutSize > BlockSizeUser for CtVariableCoreWrapper < T , OutSize >
58
50
where
59
51
T : VariableOutputCore ,
60
52
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
63
55
type BlockSize = T :: BlockSize ;
64
56
}
65
57
66
- impl < T , OutSize , O > UpdateCore for CtVariableCoreWrapper < T , OutSize , O >
58
+ impl < T , OutSize > UpdateCore for CtVariableCoreWrapper < T , OutSize >
67
59
where
68
60
T : VariableOutputCore ,
69
61
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
75
67
}
76
68
}
77
69
78
- impl < T , OutSize , O > OutputSizeUser for CtVariableCoreWrapper < T , OutSize , O >
70
+ impl < T , OutSize > OutputSizeUser for CtVariableCoreWrapper < T , OutSize >
79
71
where
80
72
T : VariableOutputCore ,
81
73
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
84
76
type OutputSize = OutSize ;
85
77
}
86
78
87
- impl < T , OutSize , O > BufferKindUser for CtVariableCoreWrapper < T , OutSize , O >
79
+ impl < T , OutSize > BufferKindUser for CtVariableCoreWrapper < T , OutSize >
88
80
where
89
81
T : VariableOutputCore ,
90
82
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
93
85
type BufferKind = T :: BufferKind ;
94
86
}
95
87
96
- impl < T , OutSize , O > FixedOutputCore for CtVariableCoreWrapper < T , OutSize , O >
88
+ impl < T , OutSize > FixedOutputCore for CtVariableCoreWrapper < T , OutSize >
97
89
where
98
90
T : VariableOutputCore ,
99
91
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -116,7 +108,7 @@ where
116
108
}
117
109
}
118
110
119
- impl < T , OutSize , O > Default for CtVariableCoreWrapper < T , OutSize , O >
111
+ impl < T , OutSize > Default for CtVariableCoreWrapper < T , OutSize >
120
112
where
121
113
T : VariableOutputCore ,
122
114
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -131,7 +123,7 @@ where
131
123
}
132
124
}
133
125
134
- impl < T , OutSize , O > CustomizedInit for CtVariableCoreWrapper < T , OutSize , O >
126
+ impl < T , OutSize > CustomizedInit for CtVariableCoreWrapper < T , OutSize >
135
127
where
136
128
T : VariableOutputCore + VarOutputCustomized ,
137
129
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -146,7 +138,7 @@ where
146
138
}
147
139
}
148
140
149
- impl < T , OutSize , O > Reset for CtVariableCoreWrapper < T , OutSize , O >
141
+ impl < T , OutSize > Reset for CtVariableCoreWrapper < T , OutSize >
150
142
where
151
143
T : VariableOutputCore ,
152
144
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -158,7 +150,7 @@ where
158
150
}
159
151
}
160
152
161
- impl < T , OutSize , O > AlgorithmName for CtVariableCoreWrapper < T , OutSize , O >
153
+ impl < T , OutSize > AlgorithmName for CtVariableCoreWrapper < T , OutSize >
162
154
where
163
155
T : VariableOutputCore + AlgorithmName ,
164
156
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -171,27 +163,16 @@ where
171
163
}
172
164
}
173
165
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
-
185
166
#[ 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 >
187
168
where
188
169
T : VariableOutputCore + zeroize:: ZeroizeOnDrop ,
189
170
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
190
171
LeEq < OutSize , T :: OutputSize > : NonZero ,
191
172
{
192
173
}
193
174
194
- impl < T , OutSize , O > fmt:: Debug for CtVariableCoreWrapper < T , OutSize , O >
175
+ impl < T , OutSize > fmt:: Debug for CtVariableCoreWrapper < T , OutSize >
195
176
where
196
177
T : VariableOutputCore + AlgorithmName ,
197
178
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
@@ -202,26 +183,10 @@ where
202
183
}
203
184
}
204
185
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
-
221
186
type CtVariableCoreWrapperSerializedStateSize < T > =
222
187
Sum < <T as SerializableState >:: SerializedStateSize , U1 > ;
223
188
224
- impl < T , OutSize , O > SerializableState for CtVariableCoreWrapper < T , OutSize , O >
189
+ impl < T , OutSize > SerializableState for CtVariableCoreWrapper < T , OutSize >
225
190
where
226
191
T : VariableOutputCore + SerializableState ,
227
192
OutSize : ArraySize + IsLessOrEqual < T :: OutputSize > ,
0 commit comments