protected override BitString ComputeSharedSecret(ISecretKeyingMaterial otherPartyKeyingMaterial)
        {
            // Party U uses both its static and ephemeral keys, and Party V's static public key
            if (SchemeParameters.KeyAgreementRole == KeyAgreementRole.InitiatorPartyU)
            {
                return(_mqv.GenerateSharedSecretZ(
                           (EccDomainParameters)ThisPartyKeyingMaterial.DomainParameters,
                           (EccKeyPair)ThisPartyKeyingMaterial.StaticKeyPair,
                           (EccKeyPair)otherPartyKeyingMaterial.StaticKeyPair,
                           (EccKeyPair)ThisPartyKeyingMaterial.EphemeralKeyPair,
                           (EccKeyPair)ThisPartyKeyingMaterial.EphemeralKeyPair,
                           (EccKeyPair)otherPartyKeyingMaterial.StaticKeyPair
                           ).SharedSecretZ);
            }

            // Party V uses its static key, and party U's static and ephemeral keys
            return(_mqv.GenerateSharedSecretZ(
                       (EccDomainParameters)ThisPartyKeyingMaterial.DomainParameters,
                       (EccKeyPair)ThisPartyKeyingMaterial.StaticKeyPair,
                       (EccKeyPair)otherPartyKeyingMaterial.StaticKeyPair,
                       (EccKeyPair)ThisPartyKeyingMaterial.StaticKeyPair,
                       (EccKeyPair)ThisPartyKeyingMaterial.StaticKeyPair,
                       (EccKeyPair)otherPartyKeyingMaterial.EphemeralKeyPair
                       ).SharedSecretZ);
        }
Example #2
0
        protected override BitString ComputeSharedSecret(OtherPartySharedInformation <FfcDomainParameters, FfcKeyPair> otherPartyInformation)
        {
            // Party U uses both its static and ephemeral keys, and Party V's static public key
            if (SchemeParameters.KeyAgreementRole == KeyAgreementRole.InitiatorPartyU)
            {
                return(_mqv.GenerateSharedSecretZ(
                           DomainParameters,
                           StaticKeyPair,
                           otherPartyInformation.StaticPublicKey,
                           EphemeralKeyPair,
                           EphemeralKeyPair,
                           otherPartyInformation.StaticPublicKey
                           ).SharedSecretZ);
            }

            // Party V uses its static key, and party U's static and ephemeral keys
            return(_mqv.GenerateSharedSecretZ(
                       DomainParameters,
                       StaticKeyPair,
                       otherPartyInformation.StaticPublicKey,
                       StaticKeyPair,
                       StaticKeyPair,
                       otherPartyInformation.EphemeralPublicKey
                       ).SharedSecretZ);
        }
Example #3
0
 protected override BitString ComputeSharedSecret(OtherPartySharedInformation <FfcDomainParameters, FfcKeyPair> otherPartyInformation)
 {
     return(_mqv.GenerateSharedSecretZ(
                DomainParameters,
                StaticKeyPair,
                otherPartyInformation.StaticPublicKey,
                EphemeralKeyPair,
                EphemeralKeyPair,
                otherPartyInformation.EphemeralPublicKey
                ).SharedSecretZ);
 }
Example #4
0
 protected override BitString ComputeSharedSecret(ISecretKeyingMaterial otherPartyKeyingMaterial)
 {
     return(_mqv.GenerateSharedSecretZ(
                (EccDomainParameters)ThisPartyKeyingMaterial.DomainParameters,
                (EccKeyPair)ThisPartyKeyingMaterial.StaticKeyPair,
                (EccKeyPair)otherPartyKeyingMaterial.StaticKeyPair,
                (EccKeyPair)ThisPartyKeyingMaterial.EphemeralKeyPair,
                (EccKeyPair)ThisPartyKeyingMaterial.EphemeralKeyPair,
                (EccKeyPair)otherPartyKeyingMaterial.EphemeralKeyPair
                ).SharedSecretZ);
 }