CipherSpecs { public static CipherSpec getCipherSpec(int id) { return cipherSpecs.get(id); }  static Map<Integer, CipherSpec> getAvailableCipherSpecs(); static List<CipherSpec> getDefaultCipherSpecs(); static CipherSpec getCipherSpec(int id); static void registerCipherSpec(int id, CipherSpec cipherSpec); static final int AES_128_GCM; static final int TWOFISH_128_GCM; static final int AES_256_GCM; static final int TWOFISH_256_GCM; static final int[] DEFAULT_CIPHER_SPECS; }
@Test public void testCipherSpec2() { CipherSpec twofish128CipherSpec = CipherSpecs.getCipherSpec(CipherSpecs.TWOFISH_128_GCM); assertEquals(twofish128CipherSpec.getId(), 2); assertEquals(twofish128CipherSpec.getAlgorithm(), "Twofish/GCM/NoPadding"); assertEquals(twofish128CipherSpec.getKeySize(), 128); assertEquals(twofish128CipherSpec.getIvSize(), 128); assertEquals(twofish128CipherSpec.needsUnlimitedStrength(), false); assertNotNull(twofish128CipherSpec.toString()); }
@Test public void testCipherSpecHashCodeEquals() { CipherSpec cipherSpec1 = CipherSpecs.getCipherSpec(CipherSpecs.AES_128_GCM); CipherSpec cipherSpec2 = CipherSpecs.getCipherSpec(CipherSpecs.TWOFISH_128_GCM); assertNotSame(cipherSpec1.hashCode(), cipherSpec2.hashCode()); assertNotSame(cipherSpec1, cipherSpec2); assertEquals(0x01, cipherSpec1.getId()); }