Rename crypto methods and constants for Bluetooth key agreement

This commit is contained in:
str4d
2016-01-27 20:21:05 +00:00
parent 35090f4d0e
commit 4d7a23779a
8 changed files with 70 additions and 70 deletions

View File

@@ -13,15 +13,15 @@ import static org.junit.Assert.assertArrayEquals;
public class KeyAgreementTest extends BriarTestCase {
@Test
public void testKeyAgreement() throws Exception {
public void testBTKeyAgreement() throws Exception {
SeedProvider seedProvider = new TestSeedProvider();
CryptoComponent crypto = new CryptoComponentImpl(seedProvider);
KeyPair aPair = crypto.generateAgreementKeyPair();
byte[] aPub = aPair.getPublic().getEncoded();
KeyPair bPair = crypto.generateAgreementKeyPair();
byte[] bPub = bPair.getPublic().getEncoded();
SecretKey aMaster = crypto.deriveMasterSecret(aPub, bPair, true);
SecretKey bMaster = crypto.deriveMasterSecret(bPub, aPair, false);
SecretKey aMaster = crypto.deriveBTMasterSecret(aPub, bPair, true);
SecretKey bMaster = crypto.deriveBTMasterSecret(bPub, aPair, false);
assertArrayEquals(aMaster.getBytes(), bMaster.getBytes());
}
}