Skip to content

Commit

Permalink
Update yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.…
Browse files Browse the repository at this point in the history
…test.ts

Co-authored-by: Jan Beneš <[email protected]>
  • Loading branch information
LHerskind and benesjan authored May 9, 2024
1 parent 04a3bd0 commit 7c3c68a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ describe('aes128', () => {

// PKCS#7 padding removal
const removePadding = (paddedBuffer: Buffer): Buffer => {
// We get padding length from the last byte - in PKCS#7 all the padded bytes contain padding length
// and there is always some padding.
const paddingToRemove = paddedBuffer[paddedBuffer.length - 1];
return paddedBuffer.subarray(0, paddedBuffer.length - paddingToRemove);
};
Expand Down

0 comments on commit 7c3c68a

Please sign in to comment.