-
-
Notifications
You must be signed in to change notification settings - Fork 1
Key Agreement
Alina P edited this page Feb 25, 2025
·
3 revisions
Key Agreement (ECDH) is used to securely generate a shared secret between two parties. This secret is then used for key derivation and encryption.
Important
Curves of a private and a public keys supposed to be of the same type
Supported Curves
- P256
- P384
- P521
- Curve25519
let privateKey = P256.KeyAgreement.PrivateKey()
let publicKey = privateKey.publicKey
let sharedSecret = try M_AES_GCM_HKDF.getSharedSecret(privateKey: privateKey, publicKey: publicKey)Also it can work with the SecKey that has under known Curves
let privateKey: SecKey
let publicKey: SecKey
let sharedSecret = try M_AES_GCM_HKDF.getSharedSecret(privateKey: privateKey, publicKey: publicKey)- Issues β
- Contribution Guidelines β
- License β
- Try our macOS App β
- Become a Sponsor β
- Discord β
- Medium β
-
Linkedin β