eddsa.c File Reference

EdDSA (Edwards-Curve Digital Signature Algorithm) More...

#include "core/crypto.h"
#include "ecc/eddsa.h"
#include "mpi/mpi.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

void eddsaInitPublicKey (EddsaPublicKey *key)
 Initialize an EdDSA public key. More...
 
void eddsaFreePublicKey (EddsaPublicKey *key)
 Release an EdDSA public key. More...
 
void eddsaInitPrivateKey (EddsaPrivateKey *key)
 Initialize an EdDSA private key. More...
 
void eddsaFreePrivateKey (EddsaPrivateKey *key)
 Release an EdDSA private key. More...
 
error_t eddsaGenerateKeyPair (const PrngAlgo *prngAlgo, void *prngContext, const EcCurveInfo *curveInfo, EddsaPrivateKey *privateKey, EddsaPublicKey *publicKey)
 EdDSA key pair generation. More...
 
error_t eddsaGeneratePrivateKey (const PrngAlgo *prngAlgo, void *prngContext, const EcCurveInfo *curveInfo, EddsaPrivateKey *privateKey)
 EdDSA private key generation. More...
 
error_t eddsaGeneratePublicKey (const EcCurveInfo *curveInfo, const EddsaPrivateKey *privateKey, EddsaPublicKey *publicKey)
 Derive the public key from an EdDSA private key. More...
 

Detailed Description

EdDSA (Edwards-Curve Digital Signature Algorithm)

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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file eddsa.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 32 of file eddsa.c.

Function Documentation

◆ eddsaFreePrivateKey()

void eddsaFreePrivateKey ( EddsaPrivateKey key)

Release an EdDSA private key.

Parameters
[in]keyPointer to the EdDSA public key to free

Definition at line 89 of file eddsa.c.

◆ eddsaFreePublicKey()

void eddsaFreePublicKey ( EddsaPublicKey key)

Release an EdDSA public key.

Parameters
[in]keyPointer to the EdDSA public key to free

Definition at line 61 of file eddsa.c.

◆ eddsaGenerateKeyPair()

error_t eddsaGenerateKeyPair ( const PrngAlgo prngAlgo,
void *  prngContext,
const EcCurveInfo curveInfo,
EddsaPrivateKey privateKey,
EddsaPublicKey publicKey 
)

EdDSA key pair generation.

Parameters
[in]prngAlgoPRNG algorithm
[in]prngContextPointer to the PRNG context
[in]curveInfoElliptic curve parameters
[out]privateKeyEdDSA private key
[out]publicKeyEdDSA public key
Returns
Error code

Definition at line 107 of file eddsa.c.

◆ eddsaGeneratePrivateKey()

error_t eddsaGeneratePrivateKey ( const PrngAlgo prngAlgo,
void *  prngContext,
const EcCurveInfo curveInfo,
EddsaPrivateKey privateKey 
)

EdDSA private key generation.

Parameters
[in]prngAlgoPRNG algorithm
[in]prngContextPointer to the PRNG context
[in]curveInfoElliptic curve parameters
[out]privateKeyEdDSA private key
Returns
Error code

Definition at line 138 of file eddsa.c.

◆ eddsaGeneratePublicKey()

error_t eddsaGeneratePublicKey ( const EcCurveInfo curveInfo,
const EddsaPrivateKey privateKey,
EddsaPublicKey publicKey 
)

Derive the public key from an EdDSA private key.

Parameters
[in]curveInfoElliptic curve parameters
[in]privateKeyEdDSA private key
[out]publicKeyEdDSA public key
Returns
Error code

Definition at line 200 of file eddsa.c.

◆ eddsaInitPrivateKey()

void eddsaInitPrivateKey ( EddsaPrivateKey key)

Initialize an EdDSA private key.

Parameters
[in]keyPointer to the EdDSA private key to initialize

Definition at line 73 of file eddsa.c.

◆ eddsaInitPublicKey()

void eddsaInitPublicKey ( EddsaPublicKey key)

Initialize an EdDSA public key.

Parameters
[in]keyPointer to the EdDSA public key to initialize

Definition at line 49 of file eddsa.c.