Class EcSchemes
- Namespace
- Kdf108
- Assembly
- Kdf108.dll
The SP 800-56A Rev. 3 ECC key-agreement schemes. FfcSchemes has the same methods for finite fields. Each returns the shared secret Z, which you must pass through an SP 800-56C KDF (Sp80056C) before use, then clear. For dependency injection and logging, use IEcKeyAgreement.
public static class EcSchemes
- Inheritance
-
EcSchemes
- Inherited Members
Remarks
Method names follow the scheme categories of ยง6: Ephemeral is C(2e, 0s) "Ephemeral Unified",
Static is C(0e, 2s) "Static Unified", OneFlow is C(1e, 1s) "One-Pass Diffie-Hellman",
Hybrid is C(2e, 2s) "Full Unified", HybridOneFlow is C(1e, 2s) "One-Pass Unified",
Mqv2 is "Full MQV", and Mqv1 is "One-Pass MQV". Party U is the initiator, V the responder.
Methods
Ephemeral(EcEphemeralKeyPair, EcEphemeralPublicKey)
Ephemeral Unified, C(2e, 0s): Z = ECC CDH(local ephemeral, remote ephemeral).
public static byte[] Ephemeral(EcEphemeralKeyPair localEphemeral, EcEphemeralPublicKey remoteEphemeral)
Parameters
localEphemeralEcEphemeralKeyPairremoteEphemeralEcEphemeralPublicKey
Returns
- byte[]
Hybrid(EcStaticKeyPair, EcEphemeralKeyPair, EcStaticPublicKey, EcEphemeralPublicKey)
Full Unified, C(2e, 2s): Z = Ze || Zs.
public static byte[] Hybrid(EcStaticKeyPair localStatic, EcEphemeralKeyPair localEphemeral, EcStaticPublicKey remoteStatic, EcEphemeralPublicKey remoteEphemeral)
Parameters
localStaticEcStaticKeyPairlocalEphemeralEcEphemeralKeyPairremoteStaticEcStaticPublicKeyremoteEphemeralEcEphemeralPublicKey
Returns
- byte[]
HybridOneFlowAsPartyU(EcStaticKeyPair, EcEphemeralKeyPair, EcStaticPublicKey)
One-Pass Unified, C(1e, 2s), as party U: Z = CDH(U's ephemeral, V's static) || CDH(U's static, V's static).
public static byte[] HybridOneFlowAsPartyU(EcStaticKeyPair localStatic, EcEphemeralKeyPair localEphemeral, EcStaticPublicKey remoteStatic)
Parameters
localStaticEcStaticKeyPairlocalEphemeralEcEphemeralKeyPairremoteStaticEcStaticPublicKey
Returns
- byte[]
HybridOneFlowAsPartyV(EcStaticKeyPair, EcStaticPublicKey, EcEphemeralPublicKey)
One-Pass Unified, C(1e, 2s), as party V: Z = CDH(V's static, U's ephemeral) || CDH(V's static, U's static).
public static byte[] HybridOneFlowAsPartyV(EcStaticKeyPair localStatic, EcStaticPublicKey remoteStatic, EcEphemeralPublicKey remoteEphemeral)
Parameters
localStaticEcStaticKeyPairremoteStaticEcStaticPublicKeyremoteEphemeralEcEphemeralPublicKey
Returns
- byte[]
Mqv1AsPartyU(EcStaticKeyPair, EcEphemeralKeyPair, EcStaticPublicKey)
One-Pass MQV, C(1e, 2s), as party U: V's static key stands in for V's ephemeral key.
public static byte[] Mqv1AsPartyU(EcStaticKeyPair localStatic, EcEphemeralKeyPair localEphemeral, EcStaticPublicKey remoteStatic)
Parameters
localStaticEcStaticKeyPairlocalEphemeralEcEphemeralKeyPairremoteStaticEcStaticPublicKey
Returns
- byte[]
Mqv1AsPartyV(EcStaticKeyPair, EcStaticPublicKey, EcEphemeralPublicKey)
One-Pass MQV, C(1e, 2s), as party V: V's static key stands in for its own ephemeral key.
public static byte[] Mqv1AsPartyV(EcStaticKeyPair localStatic, EcStaticPublicKey remoteStatic, EcEphemeralPublicKey remoteEphemeral)
Parameters
localStaticEcStaticKeyPairremoteStaticEcStaticPublicKeyremoteEphemeralEcEphemeralPublicKey
Returns
- byte[]
Mqv2(EcStaticKeyPair, EcEphemeralKeyPair, EcStaticPublicKey, EcEphemeralPublicKey)
Full MQV, C(2e, 2s).
public static byte[] Mqv2(EcStaticKeyPair localStatic, EcEphemeralKeyPair localEphemeral, EcStaticPublicKey remoteStatic, EcEphemeralPublicKey remoteEphemeral)
Parameters
localStaticEcStaticKeyPairlocalEphemeralEcEphemeralKeyPairremoteStaticEcStaticPublicKeyremoteEphemeralEcEphemeralPublicKey
Returns
- byte[]
OneFlowAsPartyU(EcEphemeralKeyPair, EcStaticPublicKey)
One-Pass Diffie-Hellman, C(1e, 1s), as party U: Z = ECC CDH(U's ephemeral, V's static).
public static byte[] OneFlowAsPartyU(EcEphemeralKeyPair localEphemeral, EcStaticPublicKey remoteStatic)
Parameters
localEphemeralEcEphemeralKeyPairremoteStaticEcStaticPublicKey
Returns
- byte[]
OneFlowAsPartyV(EcStaticKeyPair, EcEphemeralPublicKey)
One-Pass Diffie-Hellman, C(1e, 1s), as party V: Z = ECC CDH(V's static, U's ephemeral).
public static byte[] OneFlowAsPartyV(EcStaticKeyPair localStatic, EcEphemeralPublicKey remoteEphemeral)
Parameters
localStaticEcStaticKeyPairremoteEphemeralEcEphemeralPublicKey
Returns
- byte[]
Static(EcStaticKeyPair, EcStaticPublicKey)
Static Unified, C(0e, 2s): Z = ECC CDH(local static, remote static).
public static byte[] Static(EcStaticKeyPair localStatic, EcStaticPublicKey remoteStatic)
Parameters
localStaticEcStaticKeyPairremoteStaticEcStaticPublicKey
Returns
- byte[]