37#ifndef SHARKSSL_PSA_CONSUMER_ECDH_H
38#define SHARKSSL_PSA_CONSUMER_ECDH_H
43#if !SHARKSSL_PSA_CONSUMER
44#error SharkSslPSAConsumerECDH.h requires SHARKSSL_PSA_CONSUMER
60 const U8 *privateKey, U16 privateKeyLen);
64 U8 *publicKey, U16 publicKeySize, U16 *publicKeyLen);
68 const U8 *peerPublicKey, U16 peerPublicKeyLen,
69 U8 *sharedSecret, U16 sharedSecretSize, U16 *sharedSecretLen);
TLS objects, certificate/session operations, and public-key interfaces.
See Choose a SharkSSL API for build scope and the owning API layer.
struct SharkSslPSAEcdhKey SharkSslPSAEcdhKey
Standalone ECDH private key owned by the external PSA provider.
SHARKSSL_API int SharkSslPSAEcdhKey_import(SharkSslPSAEcdhKey *o, U16 curveID, const U8 *privateKey, U16 privateKeyLen)
Import a private scalar: big-endian for Weierstrass, little-endian for X25519/X448.
SHARKSSL_API int SharkSslPSAEcdhKey_destructor(SharkSslPSAEcdhKey *o)
Destroy the volatile PSA key and clear this context.
SHARKSSL_API int SharkSslPSAEcdhKey_agree(const SharkSslPSAEcdhKey *o, const U8 *peerPublicKey, U16 peerPublicKeyLen, U8 *sharedSecret, U16 sharedSecretSize, U16 *sharedSecretLen)
Derive a raw shared secret; clear it on any failure, including all-zero Montgomery output.
SHARKSSL_API int SharkSslPSAEcdhKey_exportPublic(const SharkSslPSAEcdhKey *o, U8 *publicKey, U16 publicKeySize, U16 *publicKeyLen)
Export the public key as SEC1 uncompressed or RFC 7748.
SHARKSSL_API int SharkSslPSAEcdhKey_generate(SharkSslPSAEcdhKey *o, U16 curveID)
Generate a volatile ECDH private key for a supported standalone curve.
uint32_t psa_key_id_t
Definition: crypto.h:60
Standalone ECDH private key owned by the external PSA provider.
Definition: SharkSslPSAConsumerECDH.h:50
U16 curveID
Definition: SharkSslPSAConsumerECDH.h:52
psa_key_id_t handle
Definition: SharkSslPSAConsumerECDH.h:51