Common secret based on the Diffie-Hellman elliptic curve with CommonCrypto

I am looking for methods in CommonCrypto to generate a shared secret based on ECDH (Elliptic curve Diffie-Hellman). I can find proprietary implementations like this https://github.com/surespot/surespot-ios/blob/master/surespot/encryption/EncryptionController.mm , but this one does not use CommonCrypto. The method for calculating a shared secret is sometimes called "Key Exchange" and includes the calculation of a shared secret. Can someone send a link to the necessary documentation or to an example that uses CommonCrypto to generate a shared secret based on the Diffie-Hellman elliptic curve?

+4
source share
1 answer

Take a look at the CommonCrypto function from CommonECCryptor.h

CCECCryptorComputeSharedSecret (CCECCryptorRef privateKey, CCECCryptorRef publicKey, void * out, size_t * outLen)

He creates a shared Diffie-Hellman secret with ECC's private and public key. Most of the information they provide is in the header header files. CCECCryptorComputeSharedSecret header here

+2
source

Source: https://habr.com/ru/post/987908/


All Articles