Ed448 elliptic curve (constant-time implementation) More...
Go to the source code of this file.
Data Structures | |
struct | Ed448Point |
Projective point representation. More... | |
struct | Ed448State |
Ed448 working state. More... | |
Macros | |
#define | ED448_PRIVATE_KEY_LEN 57 |
#define | ED448_PUBLIC_KEY_LEN 57 |
#define | ED448_SIGNATURE_LEN 114 |
#define | ED448_PH_FLAG 1 |
#define | ED448_PH_SIZE 64 |
Functions | |
error_t | ed448GenerateKeyPair (const PrngAlgo *prngAlgo, void *prngContext, uint8_t *privateKey, uint8_t *publicKey) |
EdDSA key pair generation. More... | |
error_t | ed448GeneratePrivateKey (const PrngAlgo *prngAlgo, void *prngContext, uint8_t *privateKey) |
EdDSA private key generation. More... | |
error_t | ed448GeneratePublicKey (const uint8_t *privateKey, uint8_t *publicKey) |
Derive the public key from an EdDSA private key. More... | |
error_t | ed448GenerateSignature (const uint8_t *privateKey, const uint8_t *publicKey, const void *message, size_t messageLen, const void *context, uint8_t contextLen, uint8_t flag, uint8_t *signature) |
EdDSA signature generation. More... | |
error_t | ed448GenerateSignatureEx (const uint8_t *privateKey, const uint8_t *publicKey, const DataChunk *messageChunks, const void *context, uint8_t contextLen, uint8_t flag, uint8_t *signature) |
EdDSA signature generation. More... | |
error_t | ed448VerifySignature (const uint8_t *publicKey, const void *message, size_t messageLen, const void *context, uint8_t contextLen, uint8_t flag, const uint8_t *signature) |
EdDSA signature verification. More... | |
error_t | ed448VerifySignatureEx (const uint8_t *publicKey, const DataChunk *messageChunks, const void *context, uint8_t contextLen, uint8_t flag, const uint8_t *signature) |
EdDSA signature verification. More... | |
void | ed448Mul (Ed448State *state, Ed448Point *r, const uint8_t *k, const Ed448Point *p) |
Scalar multiplication on Ed448 curve. More... | |
void | ed448Add (Ed448State *state, Ed448Point *r, const Ed448Point *p, const Ed448Point *q) |
Point addition. More... | |
void | ed448Double (Ed448State *state, Ed448Point *r, const Ed448Point *p) |
Point doubling. More... | |
void | ed448Encode (Ed448Point *p, uint8_t *data) |
Point encoding. More... | |
uint32_t | ed448Decode (Ed448Point *p, const uint8_t *data) |
Point decoding. More... | |
void | ed448RedInt (uint8_t *r, const uint8_t *a) |
Reduce an integer modulo L. More... | |
void | ed448AddInt (uint8_t *r, const uint8_t *a, const uint8_t *b, uint_t n) |
Addition of two integers. More... | |
uint8_t | ed448SubInt (uint8_t *r, const uint8_t *a, const uint8_t *b, uint_t n) |
Subtraction of two integers. More... | |
void | ed448MulInt (uint8_t *rl, uint8_t *rh, const uint8_t *a, const uint8_t *b, uint_t n) |
Multiplication of two integers. More... | |
void | ed448CopyInt (uint8_t *a, const uint8_t *b, uint_t n) |
Copy an integer. More... | |
void | ed448SelectInt (uint8_t *r, const uint8_t *a, const uint8_t *b, uint8_t c, uint_t n) |
Select an integer. More... | |
uint8_t | ed448CompInt (const uint8_t *a, const uint8_t *b, uint_t n) |
Compare integers. More... | |
Detailed Description
Ed448 elliptic curve (constant-time implementation)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneCRYPTO Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file ed448.h.
Macro Definition Documentation
◆ ED448_PH_FLAG
◆ ED448_PH_SIZE
◆ ED448_PRIVATE_KEY_LEN
◆ ED448_PUBLIC_KEY_LEN
◆ ED448_SIGNATURE_LEN
Function Documentation
◆ ed448Add()
void ed448Add | ( | Ed448State * | state, |
Ed448Point * | r, | ||
const Ed448Point * | p, | ||
const Ed448Point * | q | ||
) |
◆ ed448AddInt()
void ed448AddInt | ( | uint8_t * | r, |
const uint8_t * | a, | ||
const uint8_t * | b, | ||
uint_t | n | ||
) |
◆ ed448CompInt()
uint8_t ed448CompInt | ( | const uint8_t * | a, |
const uint8_t * | b, | ||
uint_t | n | ||
) |
◆ ed448CopyInt()
void ed448CopyInt | ( | uint8_t * | a, |
const uint8_t * | b, | ||
uint_t | n | ||
) |
◆ ed448Decode()
uint32_t ed448Decode | ( | Ed448Point * | p, |
const uint8_t * | data | ||
) |
◆ ed448Double()
void ed448Double | ( | Ed448State * | state, |
Ed448Point * | r, | ||
const Ed448Point * | p | ||
) |
◆ ed448Encode()
void ed448Encode | ( | Ed448Point * | p, |
uint8_t * | data | ||
) |
◆ ed448GenerateKeyPair()
◆ ed448GeneratePrivateKey()
◆ ed448GeneratePublicKey()
error_t ed448GeneratePublicKey | ( | const uint8_t * | privateKey, |
uint8_t * | publicKey | ||
) |
◆ ed448GenerateSignature()
error_t ed448GenerateSignature | ( | const uint8_t * | privateKey, |
const uint8_t * | publicKey, | ||
const void * | message, | ||
size_t | messageLen, | ||
const void * | context, | ||
uint8_t | contextLen, | ||
uint8_t | flag, | ||
uint8_t * | signature | ||
) |
EdDSA signature generation.
- Parameters
-
[in] privateKey Signer's EdDSA private key (57 bytes) [in] publicKey Signer's EdDSA public key (57 bytes) [in] message Pointer to the message to be signed [in] messageLen Length of the message, in bytes [in] context Constant string specified by the protocol using it [in] contextLen Length of the context, in bytes [in] flag Prehash flag for Ed448ph scheme [out] signature EdDSA signature (114 bytes)
- Returns
- Error code
◆ ed448GenerateSignatureEx()
error_t ed448GenerateSignatureEx | ( | const uint8_t * | privateKey, |
const uint8_t * | publicKey, | ||
const DataChunk * | messageChunks, | ||
const void * | context, | ||
uint8_t | contextLen, | ||
uint8_t | flag, | ||
uint8_t * | signature | ||
) |
EdDSA signature generation.
- Parameters
-
[in] privateKey Signer's EdDSA private key (57 bytes) [in] publicKey Signer's EdDSA public key (57 bytes) [in] messageChunks Array of data chunks representing the message to be signed [in] context Constant string specified by the protocol using it [in] contextLen Length of the context, in bytes [in] flag Prehash flag for Ed448ph scheme [out] signature EdDSA signature (114 bytes)
- Returns
- Error code
◆ ed448Mul()
void ed448Mul | ( | Ed448State * | state, |
Ed448Point * | r, | ||
const uint8_t * | k, | ||
const Ed448Point * | p | ||
) |
◆ ed448MulInt()
void ed448MulInt | ( | uint8_t * | rl, |
uint8_t * | rh, | ||
const uint8_t * | a, | ||
const uint8_t * | b, | ||
uint_t | n | ||
) |
Multiplication of two integers.
- Parameters
-
[out] rl Low part of the result R = (A + B) mod (2^8)^n [out] rh High part of the result R = (A + B) / (2^8)^n [in] a An integer such as 0 <= A < (2^8)^n [in] b An integer such as 0 <= B < (2^8)^n [in] n Size of the operands, in bytes
◆ ed448RedInt()
void ed448RedInt | ( | uint8_t * | r, |
const uint8_t * | a | ||
) |
Reduce an integer modulo L.
This function implements Barrett reduction with b = 2^24 and k = 19. The algorithm requires the precomputation of the quantity mu = b^(2 * k) / L
- Parameters
-
[out] r Resulting integer R = A mod L [in] a An integer such as 0 <= A < b^(2 * k)
◆ ed448SelectInt()
void ed448SelectInt | ( | uint8_t * | r, |
const uint8_t * | a, | ||
const uint8_t * | b, | ||
uint8_t | c, | ||
uint_t | n | ||
) |
◆ ed448SubInt()
uint8_t ed448SubInt | ( | uint8_t * | r, |
const uint8_t * | a, | ||
const uint8_t * | b, | ||
uint_t | n | ||
) |
◆ ed448VerifySignature()
error_t ed448VerifySignature | ( | const uint8_t * | publicKey, |
const void * | message, | ||
size_t | messageLen, | ||
const void * | context, | ||
uint8_t | contextLen, | ||
uint8_t | flag, | ||
const uint8_t * | signature | ||
) |
EdDSA signature verification.
- Parameters
-
[in] publicKey Signer's EdDSA public key (57 bytes) [in] message Message whose signature is to be verified [in] messageLen Length of the message, in bytes [in] context Constant string specified by the protocol using it [in] contextLen Length of the context, in bytes [in] flag Prehash flag for Ed448ph scheme [in] signature EdDSA signature (114 bytes)
- Returns
- Error code
◆ ed448VerifySignatureEx()
error_t ed448VerifySignatureEx | ( | const uint8_t * | publicKey, |
const DataChunk * | messageChunks, | ||
const void * | context, | ||
uint8_t | contextLen, | ||
uint8_t | flag, | ||
const uint8_t * | signature | ||
) |
EdDSA signature verification.
- Parameters
-
[in] publicKey Signer's EdDSA public key (57 bytes) [in] messageChunks Array of data chunks representing the message whose signature is to be verified [in] context Constant string specified by the protocol using it [in] contextLen Length of the context, in bytes [in] flag Prehash flag for Ed448ph scheme [in] signature EdDSA signature (114 bytes)
- Returns
- Error code