3

我正在寻找 CommonCrypto 中的方法来生成基于 ECDH(椭圆曲线 Diffie-Hellman)的共享密钥。我可以找到像这样的专有实现https://github.com/surespot/surespot-ios/blob/master/surespot/encryption/EncryptionController.mm但这个没有使用 CommonCrypto。计算共享秘密的方法有时称为密钥交换,包括计算共享秘密。有人可以将链接发送到正确的文档或使用 CommonCrypto 生成基于椭圆曲线 Diffie-Hellman 的共享密钥的示例吗?

4

1 回答 1

1

查看 CommonECCryptor.h 中的 CommonCrypto 函数

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

它使用私有和公共 ECC 密钥构建 Diffie-Hellman 共享密钥。他们提供的大部分信息都在头文件的开始行中。 CCECCryptorComputeSharedSecret 的标头在这里

于 2014-11-05T08:00:46.597 回答