File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## 0.11.3 (UNRELEASED)
9+ ### Added
10+ - ` dev::initialized_mac_test ` function ([ #2367 ] )
11+
12+ [ #2367 ] : https://github.com/RustCrypto/traits/pull/2367
13+
814## 0.11.2 (2026-03-13)
915### Changed
1016- Do not implement ` Clone ` as part of ` (Reset)MacTraits ` in the ` buffer_fixed! ` macro ([ #2341 ] )
Original file line number Diff line number Diff line change @@ -31,6 +31,17 @@ pub fn mac_test<M: Mac + KeyInit + Clone>(
3131 return Err ( "Failed to initialize MAC instance" ) ;
3232 } ;
3333
34+ initialized_mac_test ( mac0, input, tag, trunc_side)
35+ }
36+
37+ /// Run the MAC test directly on an initialized MAC.
38+ /// This is useful for when custom initialization is needed
39+ pub fn initialized_mac_test < M : Mac + Clone > (
40+ mac0 : M ,
41+ input : & [ u8 ] ,
42+ tag : & [ u8 ] ,
43+ trunc_side : MacTruncSide ,
44+ ) -> Result < ( ) , & ' static str > {
3445 let mut mac = mac0. clone ( ) ;
3546 mac. update ( input) ;
3647 let result = mac. finalize ( ) . into_bytes ( ) ;
You can’t perform that action at this time.
0 commit comments