mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Remove method that just wraps a MAC call.
This commit is contained in:
@@ -451,15 +451,16 @@ class IntroduceeManager {
|
||||
private void deriveMacKeysAndNonces(BdfDictionary localState,
|
||||
LocalAuthor author, SecretKey secretKey, boolean alice)
|
||||
throws FormatException, GeneralSecurityException {
|
||||
// Derive two nonces and MAC keys from the shared secret key
|
||||
byte[] ourNonce = cryptoComponent.deriveKeyBindingNonce(
|
||||
alice ? ALICE_NONCE_LABEL : BOB_NONCE_LABEL, secretKey);
|
||||
byte[] theirNonce = cryptoComponent.deriveKeyBindingNonce(
|
||||
alice ? BOB_NONCE_LABEL : ALICE_NONCE_LABEL, secretKey);
|
||||
SecretKey ourMacKey = cryptoComponent.deriveKey(
|
||||
alice ? ALICE_MAC_KEY_LABEL : BOB_MAC_KEY_LABEL, secretKey);
|
||||
SecretKey theirMacKey = cryptoComponent.deriveKey(
|
||||
alice ? BOB_MAC_KEY_LABEL : ALICE_MAC_KEY_LABEL, secretKey);
|
||||
// Derive two nonces and two MAC keys from the shared secret key
|
||||
String ourNonceLabel = alice ? ALICE_NONCE_LABEL : BOB_NONCE_LABEL;
|
||||
String theirNonceLabel = alice ? BOB_NONCE_LABEL : ALICE_NONCE_LABEL;
|
||||
byte[] ourNonce = cryptoComponent.mac(ourNonceLabel, secretKey);
|
||||
byte[] theirNonce = cryptoComponent.mac(theirNonceLabel, secretKey);
|
||||
String ourKeyLabel = alice ? ALICE_MAC_KEY_LABEL : BOB_MAC_KEY_LABEL;
|
||||
String theirKeyLabel = alice ? BOB_MAC_KEY_LABEL : ALICE_MAC_KEY_LABEL;
|
||||
SecretKey ourMacKey = cryptoComponent.deriveKey(ourKeyLabel, secretKey);
|
||||
SecretKey theirMacKey =
|
||||
cryptoComponent.deriveKey(theirKeyLabel, secretKey);
|
||||
|
||||
// Save the other nonce and MAC key for the verification
|
||||
localState.put(NONCE, theirNonce);
|
||||
|
||||
@@ -755,8 +755,7 @@ public class IntroductionIntegrationTest
|
||||
// Nonce 1
|
||||
SecretKey sharedSecret = crypto.deriveSharedSecret(SHARED_SECRET_LABEL,
|
||||
eKeyPair2.getPublic(), eKeyPair1, true);
|
||||
byte[] nonce1 = crypto.deriveKeyBindingNonce(ALICE_NONCE_LABEL,
|
||||
sharedSecret);
|
||||
byte[] nonce1 = crypto.mac(ALICE_NONCE_LABEL, sharedSecret);
|
||||
|
||||
// Signature 1
|
||||
byte[] sig1 = crypto.sign(SIGNING_LABEL, nonce1,
|
||||
@@ -791,7 +790,7 @@ public class IntroductionIntegrationTest
|
||||
byte[] ePublicKeyBytes1f = eKeyPair1f.getPublic().getEncoded();
|
||||
sharedSecret = crypto.deriveSharedSecret(SHARED_SECRET_LABEL,
|
||||
eKeyPair2.getPublic(), eKeyPair1f, true);
|
||||
nonce1 = crypto.deriveKeyBindingNonce(ALICE_NONCE_LABEL, sharedSecret);
|
||||
nonce1 = crypto.mac(ALICE_NONCE_LABEL, sharedSecret);
|
||||
|
||||
// recalculate MAC
|
||||
macKey1 = crypto.deriveKey(ALICE_MAC_KEY_LABEL, sharedSecret);
|
||||
|
||||
Reference in New Issue
Block a user