@@ -8,7 +8,7 @@ use crate::{InOut, InOutBuf};
88#[ cfg( feature = "block-padding" ) ]
99use block_padding:: { PadType , Padding } ;
1010#[ cfg( feature = "block-padding" ) ]
11- use generic_array :: { ArrayLength , GenericArray } ;
11+ use hybrid_array :: { Array , ArraySize } ;
1212
1313/// Custom slice type which references one immutable (input) slice and one
1414/// mutable (output) slice. Input and output slices are either the same or
@@ -134,19 +134,19 @@ impl<'inp, 'out> InOutBufReserved<'inp, 'out, u8> {
134134 pub fn into_padded_blocks < P , BS > ( self ) -> Result < PaddedInOutBuf < ' inp , ' out , BS > , PadError >
135135 where
136136 P : Padding < BS > ,
137- BS : ArrayLength < u8 > ,
137+ BS : ArraySize ,
138138 {
139139 let bs = BS :: USIZE ;
140140 let blocks_len = self . in_len / bs;
141141 let tail_len = self . in_len - bs * blocks_len;
142142 let blocks = unsafe {
143143 InOutBuf :: from_raw (
144- self . in_ptr as * const GenericArray < u8 , BS > ,
145- self . out_ptr as * mut GenericArray < u8 , BS > ,
144+ self . in_ptr as * const Array < u8 , BS > ,
145+ self . out_ptr as * mut Array < u8 , BS > ,
146146 blocks_len,
147147 )
148148 } ;
149- let mut tail_in = GenericArray :: < u8 , BS > :: default ( ) ;
149+ let mut tail_in = Array :: < u8 , BS > :: default ( ) ;
150150 let tail_out = match P :: TYPE {
151151 PadType :: NoPadding | PadType :: Ambiguous if tail_len == 0 => None ,
152152 PadType :: NoPadding => return Err ( PadError ) ,
@@ -167,7 +167,7 @@ impl<'inp, 'out> InOutBufReserved<'inp, 'out, u8> {
167167 tail_in. as_mut_ptr ( ) ,
168168 tail_len,
169169 ) ;
170- & mut * ( self . out_ptr . add ( blen) as * mut GenericArray < u8 , BS > )
170+ & mut * ( self . out_ptr . add ( blen) as * mut Array < u8 , BS > )
171171 } ;
172172 P :: pad ( & mut tail_in, tail_len) ;
173173 Some ( out_block)
@@ -184,17 +184,17 @@ impl<'inp, 'out> InOutBufReserved<'inp, 'out, u8> {
184184/// Variant of [`InOutBuf`] with optional padded tail block.
185185#[ cfg( feature = "block-padding" ) ]
186186#[ cfg_attr( docsrs, doc( cfg( feature = "block-padding" ) ) ) ]
187- pub struct PaddedInOutBuf < ' inp , ' out , BS : ArrayLength < u8 > > {
188- blocks : InOutBuf < ' inp , ' out , GenericArray < u8 , BS > > ,
189- tail_in : GenericArray < u8 , BS > ,
190- tail_out : Option < & ' out mut GenericArray < u8 , BS > > ,
187+ pub struct PaddedInOutBuf < ' inp , ' out , BS : ArraySize > {
188+ blocks : InOutBuf < ' inp , ' out , Array < u8 , BS > > ,
189+ tail_in : Array < u8 , BS > ,
190+ tail_out : Option < & ' out mut Array < u8 , BS > > ,
191191}
192192
193193#[ cfg( feature = "block-padding" ) ]
194- impl < ' inp , ' out , BS : ArrayLength < u8 > > PaddedInOutBuf < ' inp , ' out , BS > {
194+ impl < ' inp , ' out , BS : ArraySize > PaddedInOutBuf < ' inp , ' out , BS > {
195195 /// Get full blocks.
196196 #[ inline( always) ]
197- pub fn get_blocks < ' a > ( & ' a mut self ) -> InOutBuf < ' a , ' a , GenericArray < u8 , BS > > {
197+ pub fn get_blocks < ' a > ( & ' a mut self ) -> InOutBuf < ' a , ' a , Array < u8 , BS > > {
198198 self . blocks . reborrow ( )
199199 }
200200
@@ -203,7 +203,7 @@ impl<'inp, 'out, BS: ArrayLength<u8>> PaddedInOutBuf<'inp, 'out, BS> {
203203 /// For paddings with `P::TYPE = PadType::Reversible` it always returns `Some`.
204204 #[ inline( always) ]
205205 #[ allow( clippy:: needless_option_as_deref) ]
206- pub fn get_tail_block < ' a > ( & ' a mut self ) -> Option < InOut < ' a , ' a , GenericArray < u8 , BS > > > {
206+ pub fn get_tail_block < ' a > ( & ' a mut self ) -> Option < InOut < ' a , ' a , Array < u8 , BS > > > {
207207 match self . tail_out . as_deref_mut ( ) {
208208 Some ( out_block) => Some ( ( & self . tail_in , out_block) . into ( ) ) ,
209209 None => None ,
0 commit comments