mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-04 12:24:49 +00:00
Replace implementations of Base16, Base32 and Base64 with Guava
I kept the classes in the encoding package and turned them into wrappers for Guava. I also changed the functions in the Base32 class to take and return strings insteads if character arrays.
This commit is contained in:
parent
833e75ade1
commit
10ac1af6b0
23 changed files with 88 additions and 254 deletions
|
@ -2,8 +2,8 @@ package com.beemdevelopment.aegis;
|
|||
|
||||
import com.beemdevelopment.aegis.crypto.CryptoUtils;
|
||||
import com.beemdevelopment.aegis.crypto.SCryptParameters;
|
||||
import com.beemdevelopment.aegis.encoding.EncodingException;
|
||||
import com.beemdevelopment.aegis.encoding.Hex;
|
||||
import com.beemdevelopment.aegis.encoding.HexException;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
|||
|
||||
public class SCryptTest {
|
||||
@Test
|
||||
public void testTrailingNullCollision() throws HexException {
|
||||
public void testTrailingNullCollision() throws EncodingException {
|
||||
byte[] salt = new byte[0];
|
||||
SCryptParameters params = new SCryptParameters(
|
||||
CryptoUtils.CRYPTO_SCRYPT_N,
|
||||
|
|
|
@ -2,14 +2,14 @@ package com.beemdevelopment.aegis;
|
|||
|
||||
import com.beemdevelopment.aegis.crypto.otp.OTP;
|
||||
import com.beemdevelopment.aegis.crypto.otp.TOTP;
|
||||
import com.beemdevelopment.aegis.encoding.HexException;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
public class TOTPTest {
|
||||
private static class Vector {
|
||||
|
@ -66,7 +66,7 @@ public class TOTPTest {
|
|||
};
|
||||
|
||||
@Test
|
||||
public void vectorsMatch() throws NoSuchAlgorithmException, InvalidKeyException, HexException {
|
||||
public void vectorsMatch() throws NoSuchAlgorithmException, InvalidKeyException {
|
||||
for (Vector vector : _vectors) {
|
||||
byte[] seed;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue