Skip to content

Commit

Permalink
Regression in scp02
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpaljak committed Oct 9, 2024
1 parent af7b0f3 commit 7052b67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/src/main/java/pro/javacard/gp/GPCrypto.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ public static byte[] mac_des_3des(byte[] key, byte[] data, byte[] iv) {
// If payload is more than 8 bytes, do one pass of des_cbc of everything but the last 8 (padded) bytes
// and use the rightmost 8 bytes of that as the IV for the full cbc.
if (d.length > 8) {
iv = GPCrypto.des_cbc(Arrays.copyOf(d, d.length - 8), key, iv);
byte[] des = GPCrypto.des_cbc(Arrays.copyOf(d, d.length - 8), key, iv);
iv = Arrays.copyOfRange(des, des.length - 8, des.length);
}

// Do des3_cbc of either last or only 8 bytes with the IV depending on payload length
Expand Down

0 comments on commit 7052b67

Please sign in to comment.