Remove method that just wraps a MAC call.

This commit is contained in:
akwizgran
2017-11-28 10:40:19 +00:00
parent cc87e6fd1f
commit d2348a4e7d
5 changed files with 17 additions and 34 deletions

View File

@@ -157,10 +157,8 @@ class ContactExchangeTaskImpl extends Thread implements ContactExchangeTask {
BdfWriter w = bdfWriterFactory.createWriter(streamWriter);
// Derive the nonces to be signed
byte[] aliceNonce = crypto.deriveKeyBindingNonce(ALICE_NONCE_LABEL,
masterSecret);
byte[] bobNonce = crypto.deriveKeyBindingNonce(BOB_NONCE_LABEL,
masterSecret);
byte[] aliceNonce = crypto.mac(ALICE_NONCE_LABEL, masterSecret);
byte[] bobNonce = crypto.mac(BOB_NONCE_LABEL, masterSecret);
// Exchange pseudonyms, signed nonces, and timestamps
long localTimestamp = clock.currentTimeMillis();

View File

@@ -220,12 +220,9 @@ class CryptoComponentImpl implements CryptoComponent {
@Override
public SecretKey deriveKey(String label, SecretKey k, byte[]... inputs) {
return new SecretKey(mac(label, k, inputs));
}
@Override
public byte[] deriveKeyBindingNonce(String label, SecretKey k) {
return mac(label, k);
byte[] mac = mac(label, k, inputs);
if (mac.length != SecretKey.LENGTH) throw new IllegalStateException();
return new SecretKey(mac);
}
@Override