Skip to content

Commit cb27e18

Browse files
committed
performance tweak: remove hex string conversion
1 parent ea4c339 commit cb27e18

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/com/privacylogistics/FF3Cipher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public String encrypt(String plaintext, byte[] tweak) throws BadPaddingException
249249
reverseBytes(S);
250250
logger.trace("\tS: {}", () -> byteArrayToHexString(S));
251251

252-
BigInteger y = new BigInteger(byteArrayToHexString(S), 16);
252+
BigInteger y = new BigInteger(1, S);
253253

254254
// Calculate c
255255
c = decode_int_r(A, alphabet);
@@ -373,7 +373,7 @@ public String decrypt(String ciphertext, byte[] tweak) throws BadPaddingExceptio
373373
reverseBytes(S);
374374
logger.trace("\tS: {}", () -> byteArrayToHexString(S));
375375

376-
BigInteger y = new BigInteger(byteArrayToHexString(S), 16);
376+
BigInteger y = new BigInteger(1, S);
377377

378378
// Calculate c
379379
c = decode_int_r(B, alphabet);

0 commit comments

Comments
 (0)