@@ -36,39 +36,47 @@ pub trait Mac: OutputSizeUser + Sized {
3636 Self : Reset ;
3737
3838 /// Check if tag/code value is correct for the processed input.
39+ ///
40+ /// # Errors
41+ /// Returns [`MacError`] if `tag` is not valid.
3942 fn verify ( self , tag : & Output < Self > ) -> Result < ( ) , MacError > ;
4043
4144 /// Check if tag/code value is correct for the processed input and reset
4245 /// [`Mac`] instance.
46+ ///
47+ /// # Errors
48+ /// Returns [`MacError`] if `tag` is not valid.
4349 fn verify_reset ( & mut self , tag : & Output < Self > ) -> Result < ( ) , MacError >
4450 where
4551 Self : FixedOutputReset ;
4652
4753 /// Check truncated tag correctness using all bytes
4854 /// of calculated tag.
4955 ///
50- /// Returns `Error` if `tag` is not valid or not equal in length
51- /// to MAC's output.
56+ /// # Errors
57+ /// Returns [`MacError`] if `tag` is not valid or not equal in length to this MAC's output.
5258 fn verify_slice ( self , tag : & [ u8 ] ) -> Result < ( ) , MacError > ;
5359
5460 /// Check truncated tag correctness using all bytes
5561 /// of calculated tag and reset [`Mac`] instance.
5662 ///
57- /// Returns `Error` if `tag` is not valid or not equal in length
58- /// to MAC's output.
63+ /// # Errors
64+ /// Returns [`MacError`] if `tag` is not valid or not equal in length to MAC's output.
5965 fn verify_slice_reset ( & mut self , tag : & [ u8 ] ) -> Result < ( ) , MacError >
6066 where
6167 Self : FixedOutputReset ;
6268
6369 /// Check truncated tag correctness using left side bytes
6470 /// (i.e. `tag[..n]`) of calculated tag.
6571 ///
72+ /// # Errors
6673 /// Returns `Error` if `tag` is not valid or empty.
6774 fn verify_truncated_left ( self , tag : & [ u8 ] ) -> Result < ( ) , MacError > ;
6875
6976 /// Check truncated tag correctness using right side bytes
7077 /// (i.e. `tag[n..]`) of calculated tag.
7178 ///
79+ /// # Errors
7280 /// Returns `Error` if `tag` is not valid or empty.
7381 fn verify_truncated_right ( self , tag : & [ u8 ] ) -> Result < ( ) , MacError > ;
7482}
@@ -103,7 +111,7 @@ impl<T: Update + FixedOutput + MacMarker> Mac for T {
103111 where
104112 Self : Reset ,
105113 {
106- Reset :: reset ( self )
114+ Reset :: reset ( self ) ;
107115 }
108116
109117 #[ inline]
@@ -236,7 +244,7 @@ impl<T: OutputSizeUser> Drop for CtOutput<T> {
236244 #[ cfg( feature = "zeroize" ) ]
237245 {
238246 use zeroize:: Zeroize ;
239- self . bytes . zeroize ( )
247+ self . bytes . zeroize ( ) ;
240248 }
241249 }
242250}
0 commit comments