Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
CryptoCell EC Edwards APIs
[CryptoCell EC 25519 curve APIs]
Data Structures | |
struct | CRYS_ECEDW_TempBuff_t |
Functions | |
CIMPORT_C CRYSError_t | CRYS_ECEDW_Sign (uint8_t *pSign, size_t *pSignSize, const uint8_t *pMsg, size_t msgSize, const uint8_t *pSignSecrKey, size_t secrKeySize, CRYS_ECEDW_TempBuff_t *pTempBuff) |
The function creates EC Edwards signature on the message. | |
CIMPORT_C CRYSError_t | CRYS_ECEDW_Verify (const uint8_t *pSign, size_t signSize, const uint8_t *pSignPublKey, size_t publKeySize, uint8_t *pMsg, size_t msgSize, CRYS_ECEDW_TempBuff_t *pTempBuff) |
The function verifies the EC Edwards ed25519 signature on the message. | |
CIMPORT_C CRYSError_t | CRYS_ECEDW_SeedKeyPair (const uint8_t *pSeed, size_t seedSize, uint8_t *pSecrKey, size_t *pSecrKeySize, uint8_t *pPublKey, size_t *pPublKeySize, CRYS_ECEDW_TempBuff_t *pTempBuff) |
The function randomly generates Ec ed25519 private and public keys using given seed. The generation is performed using EC Edwards ed25519 algorithm. | |
CIMPORT_C CRYSError_t | CRYS_ECEDW_KeyPair (uint8_t *pSecrKey, size_t *pSecrKeySize, uint8_t *pPublKey, size_t *pPublKeySize, void *pRndState, SaSiRndGenerateVectWorkFunc_t rndGenerateVectFunc, CRYS_ECEDW_TempBuff_t *pTempBuff) |
The function randomly generates the EC Edwards ed25519 private and public keys. The generation is performed using EC Edwards ed25519 algorithm. |
Detailed Description
- Note:
- Algorithms of Montgomery and Edwards elliptic curves cryptography were developed by Daniel.J.Bernstein.
Function Documentation
CIMPORT_C CRYSError_t CRYS_ECEDW_KeyPair | ( | uint8_t * | pSecrKey, |
size_t * | pSecrKeySize, | ||
uint8_t * | pPublKey, | ||
size_t * | pPublKeySize, | ||
void * | pRndState, | ||
SaSiRndGenerateVectWorkFunc_t | rndGenerateVectFunc, | ||
CRYS_ECEDW_TempBuff_t * | pTempBuff | ||
) |
The function randomly generates the EC Edwards ed25519 private and public keys. The generation is performed using EC Edwards ed25519 algorithm.
- Returns:
- CRYS_OK on success,
- A non-zero value on failure as defined crys_ec_mont_edw_error.h, crys_hash_error.h or crys_rnd_error.
- Parameters:
-
[out] pSecrKey Pointer to the secret key (including seed and public key). [in,out] pSecrKeySize Pointer to the size of the secret key in bytes, (must be at least 2*EC order size). [out] pPublKey Pointer to the public key. [in,out] pPublKeySize - Pointer to the size of the public key in bytes. In - the size of buffer must be at least EC modulus size; Out - the actual size. [in,out] pRndState Pointer to the RND state structure. [in] rndGenerateVectFunc Pointer to the random vector generation function. [in] pTempBuff Pointer to the temp buffer.
CIMPORT_C CRYSError_t CRYS_ECEDW_SeedKeyPair | ( | const uint8_t * | pSeed, |
size_t | seedSize, | ||
uint8_t * | pSecrKey, | ||
size_t * | pSecrKeySize, | ||
uint8_t * | pPublKey, | ||
size_t * | pPublKeySize, | ||
CRYS_ECEDW_TempBuff_t * | pTempBuff | ||
) |
The function randomly generates Ec ed25519 private and public keys using given seed. The generation is performed using EC Edwards ed25519 algorithm.
- Returns:
- CRYS_OK on success,
- A non-zero value on failure as defined crys_ec_mont_edw_error.h or crys_hash_error.h.
- Parameters:
-
[in] pSeed Pointer to the given seed. [in] seedSize Size of the seed in bytes, must be equal the EC order size in bytes. [out] pSecrKey Pointer to the secret key, including the seed, concatenated with the public key. [in,out] pSecrKeySize Pointer to the size of the secret key buffer in bytes (must be at least 2*EC order size). [out] pPublKey Pointer to the public key. [in,out] pPublKeySize Pointer to the size of the public key in bytes. In - the size of buffer must be at least EC modulus size; Out - the actual size. [in] pTempBuff Pointer to the temp buffer, for internal use.
CIMPORT_C CRYSError_t CRYS_ECEDW_Sign | ( | uint8_t * | pSign, |
size_t * | pSignSize, | ||
const uint8_t * | pMsg, | ||
size_t | msgSize, | ||
const uint8_t * | pSignSecrKey, | ||
size_t | secrKeySize, | ||
CRYS_ECEDW_TempBuff_t * | pTempBuff | ||
) |
The function creates EC Edwards signature on the message.
- Note:
- Used detached form of signature, separated from the message. Implemented algorithm of Bernstein D. etc. sign ed25519.
- Returns:
- CRYS_OK on success,
- A non-zero value on failure as defined crys_ec_mont_edw_error.h or crys_hash_error.h.
- Parameters:
-
[out] pSign Pointer to the detached signature. [in,out] pSignSize Pointer to the total size of the signature ; In - the buffer size, which (must be at least 2*EC order size); Out - the actual size of output data. [in] pMsg Pointer to the message. [in] msgSize Message size in bytes: must be less, than (CRYS_HASH_UPDATE_DATA_MAX_SIZE_IN_BYTES - 2*(EC_EDW modulus size)). [in] pSignSecrKey Pointer to the signer secret key (seed || pulKey) [in] secrKeySize Size of signer secret key in bytes: (must be 2*EC order size). [in] pTempBuff Pointer to the temp buffer.
CIMPORT_C CRYSError_t CRYS_ECEDW_Verify | ( | const uint8_t * | pSign, |
size_t | signSize, | ||
const uint8_t * | pSignPublKey, | ||
size_t | publKeySize, | ||
uint8_t * | pMsg, | ||
size_t | msgSize, | ||
CRYS_ECEDW_TempBuff_t * | pTempBuff | ||
) |
The function verifies the EC Edwards ed25519 signature on the message.
- Note:
- The input signature is in detached form, i.e. separated from the message.
- Returns:
- CRYS_OK on success,
- A non-zero value on failure as defined crys_ec_mont_edw_error.h or crys_hash_error.h.
- Parameters:
-
[in] pSign Pointer to detached signature, i.e. the signature is separated from the message. [in] signSize Size of the signature in bytes, it must be equal to two EC Order size in bytes. [in] pSignPublKey Pointer to signer public key. [in] publKeySize Size of the signer public key in bytes; must be equal to EC modulus size. [in] pMsg Pointer to the message. [in] msgSize Pointer to the message size in bytes. Must be less than (CRYS_HASH_UPDATE_DATA_MAX_SIZE_IN_BYTES - 2*(EC_EDW modulus size)). [in] pTempBuff Pointer to the temp buffer, for internal use.
Generated on Tue Jul 12 2022 13:55:21 by
