55 html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" ,
66 html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg"
77) ]
8- #![ deny( unsafe_code) ]
9- #![ warn( missing_docs, rust_2018_idioms) ]
8+ #![ allow( clippy:: explicit_counter_loop) ]
109
1110/// Constants used, reexported for convenience.
1211pub mod consts {
@@ -28,7 +27,7 @@ use cipher::{
2827 consts:: { U2 , U12 , U16 } ,
2928 typenum:: Prod ,
3029} ;
31- use core:: marker:: PhantomData ;
30+ use core:: { fmt , marker:: PhantomData } ;
3231use dbl:: Dbl ;
3332use subtle:: ConstantTimeEq ;
3433
@@ -204,7 +203,7 @@ where
204203 ) -> aead:: Result < aead:: Tag < Self > > {
205204 let max_len = 1 << ( L_TABLE_SIZE + 4 ) ;
206205 if ( buffer. len ( ) >= max_len) || ( associated_data. len ( ) >= max_len) {
207- return Err ( aead :: Error ) ;
206+ return Err ( Error ) ;
208207 }
209208
210209 // First, try to process many blocks at once.
@@ -287,7 +286,7 @@ where
287286 ) -> aead:: Result < aead:: Tag < Self > > {
288287 let max_len = 1 << ( L_TABLE_SIZE + 4 ) ;
289288 if ( buffer. len ( ) > max_len) || ( associated_data. len ( ) > max_len) {
290- return Err ( aead :: Error ) ;
289+ return Err ( Error ) ;
291290 }
292291
293292 // First, try to process many blocks at once.
@@ -477,6 +476,18 @@ where
477476 }
478477}
479478
479+ impl < Cipher , NonceSize , TagSize , const L_TABLE_SIZE : usize > fmt:: Debug
480+ for Ocb3 < Cipher , NonceSize , TagSize , L_TABLE_SIZE >
481+ where
482+ Cipher : KeySizeUser ,
483+ NonceSize : sealed:: NonceSizes ,
484+ TagSize : sealed:: TagSizes ,
485+ {
486+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
487+ f. debug_struct ( "Ocb3" ) . finish_non_exhaustive ( )
488+ }
489+ }
490+
480491/// Computes key-dependent variables defined in
481492/// https://www.rfc-editor.org/rfc/rfc7253.html#section-4.1
482493fn key_dependent_variables < Cipher , const L_TABLE_SIZE : usize > (
@@ -494,13 +505,14 @@ where
494505 #[ allow( clippy:: needless_range_loop) ]
495506 for i in 0 ..L_TABLE_SIZE {
496507 ll_i = ll_i. dbl ( ) ;
497- ll[ i] = ll_i
508+ ll[ i] = ll_i;
498509 }
499510 ( ll_star, ll_dollar, ll)
500511}
501512
502513/// Computes nonce-dependent variables as defined
503514/// in https://www.rfc-editor.org/rfc/rfc7253.html#section-4.2
515+ #[ allow( clippy:: cast_possible_truncation, reason = "TODO" ) ]
504516fn nonce_dependent_variables <
505517 Cipher : BlockSizeUser < BlockSize = U16 > + BlockCipherEncrypt ,
506518 NonceSize : sealed:: NonceSizes ,
@@ -540,6 +552,7 @@ fn nonce_dependent_variables<
540552
541553/// Computes the initial offset as defined
542554/// in https://www.rfc-editor.org/rfc/rfc7253.html#section-4.2
555+ #[ allow( clippy:: unwrap_used) ]
543556fn initial_offset <
544557 Cipher : BlockSizeUser < BlockSize = U16 > + BlockCipherEncrypt ,
545558 NonceSize : sealed:: NonceSizes ,
0 commit comments