pldubouilh / tinyp256

A minimum implementation of ECDSA-P256 signature verification with tinycrypt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A minimum implementation of ECDSA-P256 signature verification with tinycrypt

This is an implementation of ECDSA signature verification with Curve P-256, based on a minimum subset of source files from the TinyCrypt cryptographic library, with nearly no modification.

The API contains only one function

/**
 * @brief Verify an ECDSA-P256 signature on a SHA-256 digest
 * @return returns TINYP256_OK if the signature is valid
 *         returns TINYP256_FAIL if an error occurred or the signature is
 *         invalid
 *
 * @param pk IN -- ECDSA-P256 public key. Must point to a 64-byte buffer
 * containing an uncompressed point in affine coordinates (Qx, Qy)
 * @param pk_len IN -- Size of public key buffer in bytes. Must be 64.
 * @param sha256 IN -- The SHA-256 digest of the message to sign. Must point to a 32-byte buffer.
 * @param sha256_len IN -- Size of SHA-256 digest buffer in bytes. Must be 32.
 * @param sig IN -- ECDSA-P256 signature value. Must point to a 64-byte buffer
 * containing the raw (r, s) value
 * @param sig_len IN -- Size of sig buffer in bytes. Must be 64.
 *
 */
tinyp256_t tinyp256_verify(
    const uint8_t *pk, uint16_t pk_len,
    uint8_t *sha256, uint16_t sha256_len,
    uint8_t *sig, uint16_t sig_len);

Interoprating with OpenSSL

TODO

About

A minimum implementation of ECDSA-P256 signature verification with tinycrypt

License:MIT License


Languages

Language:C 96.1%Language:Shell 3.3%Language:Makefile 0.6%