nrfxlib API 0.1.0
Loading...
Searching...
No Matches
ocrypto_ecdh_p256.h File Reference
#include "ocrypto_types.h"

Go to the source code of this file.

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