nrfxlib API 0.1.0
|
Type declarations and APIs for low-level elliptic curve point operations to do Elliptic Curve Diffie-Hellman based on the NIST secp256r1 curve. More...
Functions | |
int | ocrypto_ecdh_p256_secret_key_check (const uint8_t sk[32]) |
int | ocrypto_ecdh_p256_public_key_check (const uint8_t pk[64]) |
int | ocrypto_ecdh_p256_public_key (uint8_t pk[64], const uint8_t sk[32]) |
int | ocrypto_ecdh_p256_common_secret (uint8_t r[32], const uint8_t sk[32], const uint8_t pk[64]) |
Incremental ECDH P-256 calculation. | |
This group of functions can be used to incrementally calculate the ECDH P-256 public key and common secret. Each call completes in less than 25ms on a 16MHz Cortex-M0. Use pattern: Public Key: ocrypto_ecdh_p256_public_key_init(ctx, sKey);
while (ocrypto_ecdh_p256_public_key_iterate(ctx));
res = ocrypto_ecdh_p256_public_key_final(ctx, pKey);
int ocrypto_ecdh_p256_public_key_final(ocrypto_ecdh_p256_ctx *ctx, uint8_t pk[64]) int ocrypto_ecdh_p256_public_key_iterate(ocrypto_ecdh_p256_ctx *ctx) void ocrypto_ecdh_p256_public_key_init(ocrypto_ecdh_p256_ctx *ctx, const uint8_t sk[32]) Common Secret: ocrypto_ecdh_p256_common_secret_init(ctx, sKey, pKey);
while (ocrypto_ecdh_p256_common_secret_iterate(ctx));
res = ocrypto_ecdh_p256_common_secret_final(ctx, secet);
void ocrypto_ecdh_p256_common_secret_init(ocrypto_ecdh_p256_ctx *ctx, const uint8_t sk[32], const uint8_t pk[64]) int ocrypto_ecdh_p256_common_secret_iterate(ocrypto_ecdh_p256_ctx *ctx) int ocrypto_ecdh_p256_common_secret_final(ocrypto_ecdh_p256_ctx *ctx, uint8_t r[32]) | |
void | ocrypto_ecdh_p256_public_key_init (ocrypto_ecdh_p256_ctx *ctx, const uint8_t sk[32]) |
int | ocrypto_ecdh_p256_public_key_iterate (ocrypto_ecdh_p256_ctx *ctx) |
int | ocrypto_ecdh_p256_public_key_final (ocrypto_ecdh_p256_ctx *ctx, uint8_t pk[64]) |
void | ocrypto_ecdh_p256_common_secret_init (ocrypto_ecdh_p256_ctx *ctx, const uint8_t sk[32], const uint8_t pk[64]) |
int | ocrypto_ecdh_p256_common_secret_iterate (ocrypto_ecdh_p256_ctx *ctx) |
int | ocrypto_ecdh_p256_common_secret_final (ocrypto_ecdh_p256_ctx *ctx, uint8_t r[32]) |
Type declarations and APIs for low-level elliptic curve point operations to do Elliptic Curve Diffie-Hellman based on the NIST secp256r1 curve.