Migrate Bluetooth protocol to BQP's master secret derivation

This commit is contained in:
str4d
2016-02-02 02:31:30 +00:00
parent 77e4ec381a
commit c822623677
4 changed files with 25 additions and 33 deletions

View File

@@ -29,14 +29,6 @@ public interface CryptoComponent {
/** Generates a random invitation code. */
int generateBTInvitationCode();
/**
* Derives a shared master secret from two public keys and one of the
* corresponding private keys.
* @param alice whether the private key belongs to Alice or Bob.
*/
SecretKey deriveBTMasterSecret(byte[] theirPublicKey, KeyPair ourKeyPair,
boolean alice) throws GeneralSecurityException;
/**
* Derives a confirmation code from the given master secret.
* @param alice whether the code is for use by Alice or Bob.
@@ -111,6 +103,22 @@ public interface CryptoComponent {
*/
SecretKey deriveMasterSecret(SecretKey sharedSecret);
/**
* Derives a master secret from two public keys and one of the corresponding
* private keys.
* <p/>
* Part of BQP. This is a helper method that calls
* deriveMasterSecret(deriveSharedSecret(theirPublicKey, ourKeyPair, alice))
*
* @param theirPublicKey the ephemeral public key of the remote party
* @param ourKeyPair our ephemeral keypair
* @param alice true if ourKeyPair belongs to Alice
* @return the shared secret
* @throws GeneralSecurityException
*/
SecretKey deriveMasterSecret(byte[] theirPublicKey, KeyPair ourKeyPair,
boolean alice) throws GeneralSecurityException;
/**
* Derives initial transport keys for the given transport in the given
* rotation period from the given master secret.