diff options
| author | J08nY | 2019-03-22 15:57:56 +0100 |
|---|---|---|
| committer | J08nY | 2019-03-22 15:57:56 +0100 |
| commit | 7639c08e317e863b3a57e4f3190b5f46019e646a (patch) | |
| tree | 313c9cfb991777fccf345b5180965edc6abb4851 | |
| parent | 74f08103b0b17c9139c18168e27f79efe6324eb6 (diff) | |
| download | ECTester-7639c08e317e863b3a57e4f3190b5f46019e646a.tar.gz ECTester-7639c08e317e863b3a57e4f3190b5f46019e646a.tar.zst ECTester-7639c08e317e863b3a57e4f3190b5f46019e646a.zip | |
| -rw-r--r-- | src/cz/crcs/ectester/applet/AppletBase.java | 51 | ||||
| -rw-r--r-- | src/cz/crcs/ectester/applet/EC_Consts.java | 144 |
2 files changed, 141 insertions, 54 deletions
diff --git a/src/cz/crcs/ectester/applet/AppletBase.java b/src/cz/crcs/ectester/applet/AppletBase.java index 6db2254..4669352 100644 --- a/src/cz/crcs/ectester/applet/AppletBase.java +++ b/src/cz/crcs/ectester/applet/AppletBase.java @@ -76,7 +76,7 @@ public abstract class AppletBase extends Applet { public static final byte[] VERSION = {'v', '0', '.', '3', '.', '3'}; public static final short ARRAY_LENGTH = 0x100; - public static final short APDU_MAX_LENGTH = 1024; + public static final short APDU_MAX_LENGTH = 1024;//512 // TEMPORARRY ARRAY IN RAM byte[] ramArray = null; @@ -105,11 +105,50 @@ public abstract class AppletBase extends Applet { */ short resetMemory = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_RESET); short deselectMemory = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT); - byte memoryType = (resetMemory >= deselectMemory) ? JCSystem.CLEAR_ON_RESET : JCSystem.CLEAR_ON_DESELECT; - - ramArray = JCSystem.makeTransientByteArray(ARRAY_LENGTH, memoryType); - ramArray2 = JCSystem.makeTransientByteArray(ARRAY_LENGTH, memoryType); - apduArray = JCSystem.makeTransientByteArray(APDU_MAX_LENGTH, memoryType); + short bigMem; + short smallMem; + byte bigMemType; + byte smallMemType; + if (resetMemory >= deselectMemory) { + bigMem = resetMemory; + smallMem = deselectMemory; + bigMemType = JCSystem.CLEAR_ON_RESET; + smallMemType = JCSystem.CLEAR_ON_DESELECT; + } else { + bigMem = deselectMemory; + smallMem = resetMemory; + bigMemType = JCSystem.CLEAR_ON_DESELECT; + smallMemType = JCSystem.CLEAR_ON_RESET; + } + short[] lensBig = new short[]{APDU_MAX_LENGTH + 2 * ARRAY_LENGTH, APDU_MAX_LENGTH + ARRAY_LENGTH, APDU_MAX_LENGTH,}; + short[] lensSmall = new short[]{0, ARRAY_LENGTH, 2 * ARRAY_LENGTH}; + byte[] allocsBig = new byte[]{0x07, 0x03, 0x01}; + boolean done = false; + for (short i = 0; i < 3; ++i) { + if (lensBig[i] <= bigMem && lensSmall[i] <= smallMem) { + byte allocI = 1; + while (allocI < 0x08) { + byte type = ((allocI & allocsBig[i]) != 0) ? bigMemType : smallMemType; + switch (allocI) { + case 0x01: + apduArray = JCSystem.makeTransientByteArray(APDU_MAX_LENGTH, type); + break; + case 0x02: + ramArray = JCSystem.makeTransientByteArray(ARRAY_LENGTH, type); + break; + case 0x04: + ramArray2 = JCSystem.makeTransientByteArray(ARRAY_LENGTH, type); + break; + } + allocI = (byte) (allocI << 1); + } + done = true; + break; + } + } + if (!done) { + ISOException.throwIt((short) 0x6a84); + } randomData = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM); EC_Consts.randomData = randomData; diff --git a/src/cz/crcs/ectester/applet/EC_Consts.java b/src/cz/crcs/ectester/applet/EC_Consts.java index 3f3ddb6..2883ff1 100644 --- a/src/cz/crcs/ectester/applet/EC_Consts.java +++ b/src/cz/crcs/ectester/applet/EC_Consts.java @@ -68,37 +68,43 @@ public class EC_Consts { (byte) 0xdb, (byte) 0x7c, (byte) 0x2a, (byte) 0xbf, (byte) 0x62, (byte) 0xe3, (byte) 0x5e, (byte) 0x66, (byte) 0x80, (byte) 0x76, (byte) 0xbe, (byte) 0xad, - (byte) 0x20, (byte) 0x8b}; + (byte) 0x20, (byte) 0x8b + }; public static final byte[] EC112_FP_A = new byte[]{ (byte) 0xdb, (byte) 0x7c, (byte) 0x2a, (byte) 0xbf, (byte) 0x62, (byte) 0xe3, (byte) 0x5e, (byte) 0x66, (byte) 0x80, (byte) 0x76, (byte) 0xbe, (byte) 0xad, - (byte) 0x20, (byte) 0x88}; + (byte) 0x20, (byte) 0x88 + }; public static final byte[] EC112_FP_B = new byte[]{ (byte) 0x65, (byte) 0x9e, (byte) 0xf8, (byte) 0xba, (byte) 0x04, (byte) 0x39, (byte) 0x16, (byte) 0xee, (byte) 0xde, (byte) 0x89, (byte) 0x11, (byte) 0x70, - (byte) 0x2b, (byte) 0x22}; + (byte) 0x2b, (byte) 0x22 + }; public static final byte[] EC112_FP_G_X = new byte[]{ (byte) 0x09, (byte) 0x48, (byte) 0x72, (byte) 0x39, (byte) 0x99, (byte) 0x5a, (byte) 0x5e, (byte) 0xe7, (byte) 0x6b, (byte) 0x55, (byte) 0xf9, (byte) 0xc2, - (byte) 0xf0, (byte) 0x98}; + (byte) 0xf0, (byte) 0x98 + }; public static final byte[] EC112_FP_G_Y = new byte[]{ (byte) 0xa8, (byte) 0x9c, (byte) 0xe5, (byte) 0xaf, (byte) 0x87, (byte) 0x24, (byte) 0xc0, (byte) 0xa2, (byte) 0x3e, (byte) 0x0e, (byte) 0x0f, (byte) 0xf7, - (byte) 0x75, (byte) 0x00}; + (byte) 0x75, (byte) 0x00 + }; public static final byte[] EC112_FP_R = new byte[]{ (byte) 0xdb, (byte) 0x7c, (byte) 0x2a, (byte) 0xbf, (byte) 0x62, (byte) 0xe3, (byte) 0x5e, (byte) 0x76, (byte) 0x28, (byte) 0xdf, (byte) 0xac, (byte) 0x65, - (byte) 0x61, (byte) 0xc5}; + (byte) 0x61, (byte) 0xc5 + }; public static final short EC112_FP_K = 1; @@ -108,39 +114,45 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFD, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF + }; public static final byte[] EC128_FP_A = new byte[]{ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFD, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC + }; public static final byte[] EC128_FP_B = new byte[]{ (byte) 0xE8, (byte) 0x75, (byte) 0x79, (byte) 0xC1, (byte) 0x10, (byte) 0x79, (byte) 0xF4, (byte) 0x3D, (byte) 0xD8, (byte) 0x24, (byte) 0x99, (byte) 0x3C, - (byte) 0x2C, (byte) 0xEE, (byte) 0x5E, (byte) 0xD3}; + (byte) 0x2C, (byte) 0xEE, (byte) 0x5E, (byte) 0xD3 + }; // G in compressed form / first part of ucompressed public static final byte[] EC128_FP_G_X = new byte[]{ (byte) 0x16, (byte) 0x1F, (byte) 0xF7, (byte) 0x52, (byte) 0x8B, (byte) 0x89, (byte) 0x9B, (byte) 0x2D, (byte) 0x0C, (byte) 0x28, (byte) 0x60, (byte) 0x7C, - (byte) 0xA5, (byte) 0x2C, (byte) 0x5B, (byte) 0x86}; + (byte) 0xA5, (byte) 0x2C, (byte) 0x5B, (byte) 0x86 + }; // second part of G uncompressed public static final byte[] EC128_FP_G_Y = new byte[]{ (byte) 0xCF, (byte) 0x5A, (byte) 0xC8, (byte) 0x39, (byte) 0x5B, (byte) 0xAF, (byte) 0xEB, (byte) 0x13, (byte) 0xC0, (byte) 0x2D, (byte) 0xA2, (byte) 0x92, - (byte) 0xDD, (byte) 0xED, (byte) 0x7A, (byte) 0x83}; + (byte) 0xDD, (byte) 0xED, (byte) 0x7A, (byte) 0x83 + }; // Order of G public static final byte[] EC128_FP_R = new byte[]{ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x75, (byte) 0xA3, (byte) 0x0D, (byte) 0x1B, - (byte) 0x90, (byte) 0x38, (byte) 0xA1, (byte) 0x15}; + (byte) 0x90, (byte) 0x38, (byte) 0xA1, (byte) 0x15 + }; // cofactor of G public static final short EC128_FP_K = 1; @@ -150,21 +162,24 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0x7F, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; + (byte) 0x7F, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF + }; public static final byte[] EC160_FP_A = new byte[]{ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0x7F, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC}; + (byte) 0x7F, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC + }; public static final byte[] EC160_FP_B = new byte[]{ (byte) 0x1C, (byte) 0x97, (byte) 0xBE, (byte) 0xFC, (byte) 0x54, (byte) 0xBD, (byte) 0x7A, (byte) 0x8B, (byte) 0x65, (byte) 0xAC, (byte) 0xF8, (byte) 0x9F, (byte) 0x81, (byte) 0xD4, (byte) 0xD4, (byte) 0xAD, - (byte) 0xC5, (byte) 0x65, (byte) 0xFA, (byte) 0x45}; + (byte) 0xC5, (byte) 0x65, (byte) 0xFA, (byte) 0x45 + }; // G in compressed form / first part of ucompressed public static final byte[] EC160_FP_G_X = new byte[]{ @@ -172,7 +187,8 @@ public class EC_Consts { (byte) 0x8E, (byte) 0xF5, (byte) 0x73, (byte) 0x28, (byte) 0x46, (byte) 0x64, (byte) 0x69, (byte) 0x89, (byte) 0x68, (byte) 0xC3, (byte) 0x8B, (byte) 0xB9, - (byte) 0x13, (byte) 0xCB, (byte) 0xFC, (byte) 0x82}; + (byte) 0x13, (byte) 0xCB, (byte) 0xFC, (byte) 0x82 + }; // second part of G uncompressed public static final byte[] EC160_FP_G_Y = new byte[]{ @@ -180,14 +196,16 @@ public class EC_Consts { (byte) 0x31, (byte) 0x68, (byte) 0x94, (byte) 0x7D, (byte) 0x59, (byte) 0xDC, (byte) 0xC9, (byte) 0x12, (byte) 0x04, (byte) 0x23, (byte) 0x51, (byte) 0x37, - (byte) 0x7A, (byte) 0xC5, (byte) 0xFB, (byte) 0x32}; + (byte) 0x7A, (byte) 0xC5, (byte) 0xFB, (byte) 0x32 + }; // Order of G public static final byte[] EC160_FP_R = new byte[]{ (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0xF4, (byte) 0xC8, (byte) 0xF9, (byte) 0x27, (byte) 0xAE, (byte) 0xD3, - (byte) 0xCA, (byte) 0x75, (byte) 0x22, (byte) 0x57}; + (byte) 0xCA, (byte) 0x75, (byte) 0x22, (byte) 0x57 + }; // cofactor of G public static final short EC160_FP_K = 1; @@ -199,21 +217,24 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF + }; public static final byte[] EC192_FP_A = new byte[]{ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC + }; public static final byte[] EC192_FP_B = new byte[]{ (byte) 0x64, (byte) 0x21, (byte) 0x05, (byte) 0x19, (byte) 0xE5, (byte) 0x9C, (byte) 0x80, (byte) 0xE7, (byte) 0x0F, (byte) 0xA7, (byte) 0xE9, (byte) 0xAB, (byte) 0x72, (byte) 0x24, (byte) 0x30, (byte) 0x49, (byte) 0xFE, (byte) 0xB8, (byte) 0xDE, (byte) 0xEC, - (byte) 0xC1, (byte) 0x46, (byte) 0xB9, (byte) 0xB1}; + (byte) 0xC1, (byte) 0x46, (byte) 0xB9, (byte) 0xB1 + }; // G in compressed form / first part of ucompressed public static final byte[] EC192_FP_G_X = new byte[]{ (byte) 0x18, (byte) 0x8D, (byte) 0xA8, (byte) 0x0E, @@ -221,7 +242,8 @@ public class EC_Consts { (byte) 0x7C, (byte) 0xBF, (byte) 0x20, (byte) 0xEB, (byte) 0x43, (byte) 0xA1, (byte) 0x88, (byte) 0x00, (byte) 0xF4, (byte) 0xFF, (byte) 0x0A, (byte) 0xFD, - (byte) 0x82, (byte) 0xFF, (byte) 0x10, (byte) 0x12}; + (byte) 0x82, (byte) 0xFF, (byte) 0x10, (byte) 0x12 + }; // second part of G uncompressed public static final byte[] EC192_FP_G_Y = new byte[]{ (byte) 0x07, (byte) 0x19, (byte) 0x2B, (byte) 0x95, @@ -229,7 +251,8 @@ public class EC_Consts { (byte) 0x63, (byte) 0x10, (byte) 0x11, (byte) 0xED, (byte) 0x6B, (byte) 0x24, (byte) 0xCD, (byte) 0xD5, (byte) 0x73, (byte) 0xF9, (byte) 0x77, (byte) 0xA1, - (byte) 0x1E, (byte) 0x79, (byte) 0x48, (byte) 0x11}; + (byte) 0x1E, (byte) 0x79, (byte) 0x48, (byte) 0x11 + }; // Order of G public static final byte[] EC192_FP_R = new byte[]{ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, @@ -237,7 +260,8 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x99, (byte) 0xDE, (byte) 0xF8, (byte) 0x36, (byte) 0x14, (byte) 0x6B, (byte) 0xC9, (byte) 0xB1, - (byte) 0xB4, (byte) 0xD2, (byte) 0x28, (byte) 0x31}; + (byte) 0xB4, (byte) 0xD2, (byte) 0x28, (byte) 0x31 + }; // cofactor of G public static final short EC192_FP_K = 1; @@ -249,7 +273,8 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, - (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01}; + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01 + }; public static final byte[] EC224_FP_A = new byte[]{ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, @@ -258,7 +283,8 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE + }; public static final byte[] EC224_FP_B = new byte[]{ (byte) 0xB4, (byte) 0x05, (byte) 0x0A, (byte) 0x85, @@ -267,7 +293,8 @@ public class EC_Consts { (byte) 0x50, (byte) 0x44, (byte) 0xB0, (byte) 0xB7, (byte) 0xD7, (byte) 0xBF, (byte) 0xD8, (byte) 0xBA, (byte) 0x27, (byte) 0x0B, (byte) 0x39, (byte) 0x43, - (byte) 0x23, (byte) 0x55, (byte) 0xFF, (byte) 0xB4}; + (byte) 0x23, (byte) 0x55, (byte) 0xFF, (byte) 0xB4 + }; // G in compressed form / first part of ucompressed public static final byte[] EC224_FP_G_X = new byte[]{ @@ -277,7 +304,8 @@ public class EC_Consts { (byte) 0x4A, (byte) 0x03, (byte) 0xC1, (byte) 0xD3, (byte) 0x56, (byte) 0xC2, (byte) 0x11, (byte) 0x22, (byte) 0x34, (byte) 0x32, (byte) 0x80, (byte) 0xD6, - (byte) 0x11, (byte) 0x5C, (byte) 0x1D, (byte) 0x21}; + (byte) 0x11, (byte) 0x5C, (byte) 0x1D, (byte) 0x21 + }; // second part of G uncompressed public static final byte[] EC224_FP_G_Y = new byte[]{ (byte) 0xBD, (byte) 0x37, (byte) 0x63, (byte) 0x88, @@ -286,7 +314,8 @@ public class EC_Consts { (byte) 0xCD, (byte) 0x43, (byte) 0x75, (byte) 0xA0, (byte) 0x5A, (byte) 0x07, (byte) 0x47, (byte) 0x64, (byte) 0x44, (byte) 0xD5, (byte) 0x81, (byte) 0x99, - (byte) 0x85, (byte) 0x00, (byte) 0x7E, (byte) 0x34}; + (byte) 0x85, (byte) 0x00, (byte) 0x7E, (byte) 0x34 + }; // Order of G public static final byte[] EC224_FP_R = new byte[]{ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, @@ -295,7 +324,8 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0x16, (byte) 0xA2, (byte) 0xE0, (byte) 0xB8, (byte) 0xF0, (byte) 0x3E, (byte) 0x13, (byte) 0xDD, (byte) 0x29, (byte) 0x45, - (byte) 0x5C, (byte) 0x5C, (byte) 0x2A, (byte) 0x3D}; + (byte) 0x5C, (byte) 0x5C, (byte) 0x2A, (byte) 0x3D + }; // cofactor of G public static final short EC224_FP_K = 1; @@ -308,7 +338,8 @@ public class EC_Consts { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF + }; public static final byte[] EC256_FP_A = new byte[]{ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, @@ -317,7 +348,8 @@ public class EC_Consts { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC + }; public static final byte[] EC256_FP_B = new byte[]{ (byte) 0x5A, (byte) 0xC6, (byte) 0x35, (byte) 0xD8, (byte) 0xAA, (byte) 0x3A, (byte) 0x93, (byte) 0xE7, @@ -326,7 +358,8 @@ public class EC_Consts { (byte) 0x65, (byte) 0x1D, (byte) 0x06, (byte) 0xB0, (byte) 0xCC, (byte) 0x53, (byte) 0xB0, (byte) 0xF6, (byte) 0x3B, (byte) 0xCE, (byte) 0x3C, (byte) 0x3E, - (byte) 0x27, (byte) 0xD2, (byte) 0x60, (byte) 0x4B}; + (byte) 0x27, (byte) 0xD2, (byte) 0x60, (byte) 0x4B + }; // G in compressed form / first part of ucompressed public static final byte[] EC256_FP_G_X = new byte[]{ (byte) 0x6B, (byte) 0x17, (byte) 0xD1, (byte) 0xF2, @@ -336,7 +369,8 @@ public class EC_Consts { (byte) 0x77, (byte) 0x03, (byte) 0x7D, (byte) 0x81, (byte) 0x2D, (byte) 0xEB, (byte) 0x33, (byte) 0xA0, (byte) 0xF4, (byte) 0xA1, (byte) 0x39, (byte) 0x45, - (byte) 0xD8, (byte) 0x98, (byte) 0xC2, (byte) 0x96}; + (byte) 0xD8, (byte) 0x98, (byte) 0xC2, (byte) 0x96 + }; // second part of G uncompressed public static final byte[] EC256_FP_G_Y = new byte[]{ (byte) 0x4F, (byte) 0xE3, (byte) 0x42, (byte) 0xE2, @@ -346,7 +380,8 @@ public class EC_Consts { (byte) 0x2B, (byte) 0xCE, (byte) 0x33, (byte) 0x57, (byte) 0x6B, (byte) 0x31, (byte) 0x5E, (byte) 0xCE, (byte) 0xCB, (byte) 0xB6, (byte) 0x40, (byte) 0x68, - (byte) 0x37, (byte) 0xBF, (byte) 0x51, (byte) 0xF5}; + (byte) 0x37, (byte) 0xBF, (byte) 0x51, (byte) 0xF5 + }; // Order of G public static final byte[] EC256_FP_R = new byte[]{ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, @@ -356,7 +391,8 @@ public class EC_Consts { (byte) 0xBC, (byte) 0xE6, (byte) 0xFA, (byte) 0xAD, (byte) 0xA7, (byte) 0x17, (byte) 0x9E, (byte) 0x84, (byte) 0xF3, (byte) 0xB9, (byte) 0xCA, (byte) 0xC2, - (byte) 0xFC, (byte) 0x63, (byte) 0x25, (byte) 0x51}; + (byte) 0xFC, (byte) 0x63, (byte) 0x25, (byte) 0x51 + }; // cofactor of G public static final short EC256_FP_K = 1; @@ -373,7 +409,8 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF + }; public static final byte[] EC384_FP_A = new byte[]{ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, @@ -387,7 +424,8 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC + }; public static final byte[] EC384_FP_B = new byte[]{ (byte) 0xB3, (byte) 0x31, (byte) 0x2F, (byte) 0xA7, @@ -401,7 +439,8 @@ public class EC_Consts { (byte) 0xC6, (byte) 0x56, (byte) 0x39, (byte) 0x8D, (byte) 0x8A, (byte) 0x2E, (byte) 0xD1, (byte) 0x9D, (byte) 0x2A, (byte) 0x85, (byte) 0xC8, (byte) 0xED, - (byte) 0xD3, (byte) 0xEC, (byte) 0x2A, (byte) 0xEF}; + (byte) 0xD3, (byte) 0xEC, (byte) 0x2A, (byte) 0xEF + }; // G in compressed form / first part of ucompressed public static final byte[] EC384_FP_G_X = new byte[]{ @@ -416,7 +455,8 @@ public class EC_Consts { (byte) 0x55, (byte) 0x02, (byte) 0xF2, (byte) 0x5D, (byte) 0xBF, (byte) 0x55, (byte) 0x29, (byte) 0x6C, (byte) 0x3A, (byte) 0x54, (byte) 0x5E, (byte) 0x38, - (byte) 0x72, (byte) 0x76, (byte) 0x0A, (byte) 0xB7}; + (byte) 0x72, (byte) 0x76, (byte) 0x0A, (byte) 0xB7 + }; // second part of G uncompressed public static final byte[] EC384_FP_G_Y = new byte[]{ (byte) 0x36, (byte) 0x17, (byte) 0xDE, (byte) 0x4A, @@ -430,7 +470,8 @@ public class EC_Consts { (byte) 0x0A, (byte) 0x60, (byte) 0xB1, (byte) 0xCE, (byte) 0x1D, (byte) 0x7E, (byte) 0x81, (byte) 0x9D, (byte) 0x7A, (byte) 0x43, (byte) 0x1D, (byte) 0x7C, - (byte) 0x90, (byte) 0xEA, (byte) 0x0E, (byte) 0x5F}; + (byte) 0x90, (byte) 0xEA, (byte) 0x0E, (byte) 0x5F + }; // Order of G public static final byte[] EC384_FP_R = new byte[]{ @@ -445,7 +486,8 @@ public class EC_Consts { (byte) 0x58, (byte) 0x1A, (byte) 0x0D, (byte) 0xB2, (byte) 0x48, (byte) 0xB0, (byte) 0xA7, (byte) 0x7A, (byte) 0xEC, (byte) 0xEC, (byte) 0x19, (byte) 0x6A, - (byte) 0xCC, (byte) 0xC5, (byte) 0x29, (byte) 0x73}; + (byte) 0xCC, (byte) 0xC5, (byte) 0x29, (byte) 0x73 + }; // cofactor of G public static final short EC384_FP_K = 1; @@ -468,7 +510,8 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF + }; public static final byte[] EC521_FP_A = new byte[]{ (byte) 0x01, (byte) 0xFF, @@ -487,7 +530,8 @@ public class EC_Consts { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, - (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC}; + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC + }; public static final byte[] EC521_FP_B = new byte[]{ (byte) 0x00, (byte) 0x51, (byte) 0x95, (byte) 0x3E, @@ -506,7 +550,8 @@ public class EC_Consts { (byte) 0xDF, (byte) 0x88, (byte) 0x3D, (byte) 0x2C, (byte) 0x34, (byte) 0xF1, (byte) 0xEF, (byte) 0x45, (byte) 0x1F, (byte) 0xD4, (byte) 0x6B, (byte) 0x50, - (byte) 0x3F, (byte) 0x00}; + (byte) 0x3F, (byte) 0x00 + }; // G in compressed form / first part of ucompressed public static final byte[] EC521_FP_G_X = new byte[]{ @@ -526,7 +571,8 @@ public class EC_Consts { (byte) 0xB3, (byte) 0xC1, (byte) 0x85, (byte) 0x6A, (byte) 0x42, (byte) 0x9B, (byte) 0xF9, (byte) 0x7E, (byte) 0x7E, (byte) 0x31, (byte) 0xC2, (byte) 0xE5, - (byte) 0xBD, (byte) 0x66}; + (byte) 0xBD, (byte) 0x66 + }; // second part of G uncompressed public static final byte[] EC521_FP_G_Y = new byte[]{ @@ -546,7 +592,8 @@ public class EC_Consts { (byte) 0x70, (byte) 0x86, (byte) 0xA2, (byte) 0x72, (byte) 0xC2, (byte) 0x40, (byte) 0x88, (byte) 0xBE, (byte) 0x94, (byte) 0x76, (byte) 0x9F, (byte) 0xD1, - (byte) 0x66, (byte) 0x50}; + (byte) 0x66, (byte) 0x50 + }; // Order of G public static final byte[] EC521_FP_R = new byte[]{ @@ -566,7 +613,8 @@ public class EC_Consts { (byte) 0x3B, (byte) 0xB5, (byte) 0xC9, (byte) 0xB8, (byte) 0x89, (byte) 0x9C, (byte) 0x47, (byte) 0xAE, (byte) 0xBB, (byte) 0x6F, (byte) 0xB7, (byte) 0x1E, - (byte) 0x91, (byte) 0x38, (byte) 0x64, (byte) 0x09}; + (byte) 0x91, (byte) 0x38, (byte) 0x64, (byte) 0x09 + }; // cofactor of G public static final short EC521_FP_K = 1; |
