nrfxlib API 2.7.99
Loading...
Searching...
No Matches

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:

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:

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])
 

Detailed Description

Type declarations and APIs for low-level elliptic curve point operations to do Elliptic Curve Diffie-Hellman based on the NIST secp256r1 curve.