From e9584d79b805fc20db824f8d81d9a1bbdc7619aa Mon Sep 17 00:00:00 2001 From: c0de Date: Wed, 4 Oct 2023 13:47:21 -0500 Subject: [PATCH] Reduce internal buffer size by 330 bytes This sets the value to hold only rsa 2048 length (949) + 1 bytes --- src/dev/c0de/smartpgp/Constants.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dev/c0de/smartpgp/Constants.java b/src/dev/c0de/smartpgp/Constants.java index 1a5dcc2..dc8593d 100644 --- a/src/dev/c0de/smartpgp/Constants.java +++ b/src/dev/c0de/smartpgp/Constants.java @@ -25,8 +25,8 @@ import javacard.framework.*; public final class Constants { - protected static final short INTERNAL_BUFFER_MAX_LENGTH = - (short)0x500; + /* 0x3b6 for rsa 2048; 0x50f for rsa 3072; 0x66d for rsa 4096 */ + protected static final short INTERNAL_BUFFER_MAX_LENGTH = (short)0x3b6; // Max size of key in bytes protected static final short APDU_MAX_LENGTH = (short)0x400;