File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -585,16 +585,14 @@ pub fn Pss(comptime Hash: type) type {
585585 var em = out [0.. em_len ];
586586 em [em .len - 1 ] = 0xbc ;
587587
588- var mp_buf : [max_modulus_len ]u8 = undefined ;
589588 // M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt;
590- const mp = mp_buf [0 .. 8 + Hash .digest_length + s_len ];
591- @memset (mp [0.. 8], 0 );
592- @memcpy (mp [8.. ][0.. Hash .digest_length ], & msg_hash );
593- @memcpy (mp [8 + Hash .digest_length .. ][0.. s_len ], salt );
594-
595589 // H = Hash(M')
596590 const hash = em [em .len - 1 - Hash .digest_length .. ][0.. Hash .digest_length ];
597- Hash .hash (mp , hash , .{});
591+ var hasher = Hash .init (.{});
592+ hasher .update (&([_ ]u8 {0 } ** 8 ));
593+ hasher .update (& msg_hash );
594+ hasher .update (salt );
595+ hasher .final (hash );
598596
599597 // DB = PS || 0x01 || salt
600598 var db = em [0 .. em_len - Hash .digest_length - 1 ];
You can’t perform that action at this time.
0 commit comments