Data Structures | |
struct | CRYS_ECMONT_ScalrMultTempBuff_t |
struct | CRYS_ECMONT_TempBuff_t |
Macros | |
#define | CRYS_ECMONT_MOD_SIZE_IN_BITS 255U |
#define | CRYS_ECMONT_MOD_SIZE_IN_32BIT_WORDS ((CRYS_ECMONT_MOD_SIZE_IN_BITS + SASI_BITS_IN_32BIT_WORD - 1) / SASI_BITS_IN_32BIT_WORD) |
#define | CRYS_ECMONT_MOD_SIZE_IN_BYTES ((CRYS_ECMONT_MOD_SIZE_IN_BITS + SASI_BITS_IN_32BIT_WORD - 1) / sizeof(uint32_t)) |
#define | CRYS_ECMONT_SCALARBYTES (CRYS_ECMONT_MOD_SIZE_IN_32BIT_WORDS * SASI_32BIT_WORD_SIZE) |
#define | CRYS_ECMONT_SCALARMULTBYTES (CRYS_ECMONT_MOD_SIZE_IN_32BIT_WORDS * SASI_32BIT_WORD_SIZE) |
#define | CRYS_ECMONT_SEEDBYTES (CRYS_ECMONT_MOD_SIZE_IN_32BIT_WORDS * SASI_32BIT_WORD_SIZE) |
Enumerations |
Functions | |
CRYSError_t | CRYS_ECMONT_Scalarmult (uint8_t *pResPoint, size_t *pResPointSize, const uint8_t *pScalar, size_t scalarSize, const uint8_t *pInPoint, size_t inPointSize, CRYS_ECMONT_TempBuff_t *pEcMontTempBuff) |
The function performs EC Montgomery (Curve25519) scalar multiplication: resPoint = scalar * point. More... | |
CRYSError_t | CRYS_ECMONT_ScalarmultBase (uint8_t *pResPoint, size_t *pResPointSize, const uint8_t *pScalar, size_t scalarSize, CRYS_ECMONT_TempBuff_t *pEcMontTempBuff) |
The function performs EC Montgomery (Curve25519) scalar multiplication of base point: res = scalar * base_point. More... | |
CRYSError_t | CRYS_ECMONT_KeyPair (uint8_t *pPublKey, size_t *pPublKeySize, uint8_t *pSecrKey, size_t *pSecrKeySize, void *pRndState, SaSiRndGenerateVectWorkFunc_t rndGenerateVectFunc, CRYS_ECMONT_TempBuff_t *pEcMontTempBuff) |
The function randomly generates private and public keys for Montgomery Curve25519. More... | |
CRYSError_t | CRYS_ECMONT_SeedKeyPair (uint8_t *pPublKey, size_t *pPublKeySize, uint8_t *pSecrKey, size_t *pSecrKeySize, const uint8_t *pSeed, size_t seedSize, CRYS_ECMONT_TempBuff_t *pEcMontTempBuff) |
The function generates private and public keys for Montgomery algorithms. More... | |
#define CRYS_ECMONT_MOD_SIZE_IN_32BIT_WORDS ((CRYS_ECMONT_MOD_SIZE_IN_BITS + SASI_BITS_IN_32BIT_WORD - 1) / SASI_BITS_IN_32BIT_WORD) |
EC Montgomery modulus size in words.
Definition at line 64 of file crys_ec_mont_api.h.
#define CRYS_ECMONT_MOD_SIZE_IN_BITS 255U |
EC Montgomery curve25519 modulus size in bits, words and bytes
EC Montgomery modulus size in bits.
Definition at line 62 of file crys_ec_mont_api.h.
#define CRYS_ECMONT_MOD_SIZE_IN_BYTES ((CRYS_ECMONT_MOD_SIZE_IN_BITS + SASI_BITS_IN_32BIT_WORD - 1) / sizeof(uint32_t)) |
EC Montgomery modulus size in bytes.
Definition at line 66 of file crys_ec_mont_api.h.
#define CRYS_ECMONT_SCALARBYTES (CRYS_ECMONT_MOD_SIZE_IN_32BIT_WORDS * SASI_32BIT_WORD_SIZE) |
Constant sizes of special EC_MONT buffers and arrays
EC Montgomery scalar size in bytes.
Definition at line 70 of file crys_ec_mont_api.h.
#define CRYS_ECMONT_SCALARMULTBYTES (CRYS_ECMONT_MOD_SIZE_IN_32BIT_WORDS * SASI_32BIT_WORD_SIZE) |
EC Montgomery scalar multiplication size in bytes.
Definition at line 72 of file crys_ec_mont_api.h.
#define CRYS_ECMONT_SEEDBYTES (CRYS_ECMONT_MOD_SIZE_IN_32BIT_WORDS * SASI_32BIT_WORD_SIZE) |
EC Montgomery scalar seed size in bytes.
Definition at line 74 of file crys_ec_mont_api.h.
EC Montgomery domains ID-s enumerator.
Enumerator | |
---|---|
CRYS_ECMONT_DOMAIN_CURVE_25519 |
EC Curve25519. |
CRYS_ECMONT_DOMAIN_OFF_MODE |
EC Montgomery last domain. |
CRYS_ECMONT_DOMAIN_LAST |
Reserved. |
Definition at line 77 of file crys_ec_mont_api.h.
CRYSError_t CRYS_ECMONT_KeyPair | ( | uint8_t * | pPublKey, |
size_t * | pPublKeySize, | ||
uint8_t * | pSecrKey, | ||
size_t * | pSecrKeySize, | ||
void * | pRndState, | ||
SaSiRndGenerateVectWorkFunc_t | rndGenerateVectFunc, | ||
CRYS_ECMONT_TempBuff_t * | pEcMontTempBuff | ||
) |
The function randomly generates private and public keys for Montgomery Curve25519.
[out] | pPublKey | Pointer to the public key. |
[in,out] | pPublKeySize | Pointer to the size of the public key in bytes. In - the size of the buffer must be at least EC order size (for curve25519 - 32 bytes); Out - the actual size. |
[out] | pSecrKey | Pointer to the secret key, including. |
[in,out] | pSecrKeySize | Pointer to the size of buffer for the secret key in bytes - must be at least EC order size (for curve25519 - 32 bytes). |
[in,out] | pRndState | Pointer to the RND state structure. |
[in] | rndGenerateVectFunc | Pointer to the random vector generation function. |
[in] | pEcMontTempBuff | Pointer to the temp buffer, for internal use. |
CRYSError_t CRYS_ECMONT_Scalarmult | ( | uint8_t * | pResPoint, |
size_t * | pResPointSize, | ||
const uint8_t * | pScalar, | ||
size_t | scalarSize, | ||
const uint8_t * | pInPoint, | ||
size_t | inPointSize, | ||
CRYS_ECMONT_TempBuff_t * | pEcMontTempBuff | ||
) |
The function performs EC Montgomery (Curve25519) scalar multiplication: resPoint = scalar * point.
[out] | pResPoint | Pointer to the public (secret) key. |
[in,out] | pResPointSize | Pointer to the size of the public key in bytes. In - the size of the buffer. must be at least EC modulus size (for curve25519 - 32 bytes). Out - the actual size. |
[in] | pScalar | Pointer to the secret (private) key. |
[in] | scalarSize | Pointer to the size of the secret key in bytes; must be equal to EC order size (for curve25519 - 32 bytes). |
[in] | pInPoint | Pointer to the input point (compressed). |
[in] | inPointSize | Size of the point - must be equal to CRYS_ECMONT_MOD_SIZE_IN_BYTES. |
[in] | pEcMontTempBuff | Pointer to temp buffer, for internal use. |
CRYSError_t CRYS_ECMONT_ScalarmultBase | ( | uint8_t * | pResPoint, |
size_t * | pResPointSize, | ||
const uint8_t * | pScalar, | ||
size_t | scalarSize, | ||
CRYS_ECMONT_TempBuff_t * | pEcMontTempBuff | ||
) |
The function performs EC Montgomery (Curve25519) scalar multiplication of base point: res = scalar * base_point.
Note: all byte arrays have LE order of bytes, i.e. LS byte is on left most place.
[out] | pResPoint | Pointer to the public (secret) key. |
[in,out] | pResPointSize | Pointer to the size of the public key in bytes. In - the size of buffer must be at least EC modulus size (for curve25519 - 32 bytes); Out - the actual size. |
[in] | pScalar | Pointer to the secret (private) key. |
[in] | scalarSize | Pointer to the size of the scalar in bytes - must be equal to EC order size (for curve25519 - 32 bytes). |
[in] | pEcMontTempBuff | Pointer to temp buffer, for internal use. |
CRYSError_t CRYS_ECMONT_SeedKeyPair | ( | uint8_t * | pPublKey, |
size_t * | pPublKeySize, | ||
uint8_t * | pSecrKey, | ||
size_t * | pSecrKeySize, | ||
const uint8_t * | pSeed, | ||
size_t | seedSize, | ||
CRYS_ECMONT_TempBuff_t * | pEcMontTempBuff | ||
) |
The function generates private and public keys for Montgomery algorithms.
The generation performed using given seed.
[out] | pPublKey | Pointer to the public (secret) key. |
[in,out] | pPublKeySize | Pointer to the size of the public key in bytes. In - the size of buffer must be at least EC order size (for curve25519 - 32 bytes); Out - the actual size. |
[out] | pSecrKey | Pointer to the secret (private) key. |
[in,out] | pSecrKeySize | Pointer to the size of the secret key in bytes In - the size of buffer must be at least EC order size (for curve25519 - 32 bytes); Out - the actual size. |
[in] | pSeed | Pointer to the given seed - 32 bytes. |
[in] | seedSize | Size of the seed in bytes (must be equal to CRYS_ECMONT_SEEDBYTES). |
[in] | pEcMontTempBuff | Pointer to a temp buffer, for internal use. |