ECDSA (Elliptic Curve Digital Signature Algorithm) More...
#include "core/crypto.h"
#include "ecc/ecdsa.h"
#include "mpi/mpi.h"
#include "encoding/asn1.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
void | ecdsaInitSignature (EcdsaSignature *signature) |
Initialize an ECDSA signature. More... | |
void | ecdsaFreeSignature (EcdsaSignature *signature) |
Release an ECDSA signature. More... | |
error_t | ecdsaWriteSignature (const EcdsaSignature *signature, uint8_t *data, size_t *length) |
Encode ECDSA signature using ASN.1. More... | |
error_t | ecdsaReadSignature (const uint8_t *data, size_t length, EcdsaSignature *signature) |
Read an ASN.1 encoded ECDSA signature. More... | |
__weak_func error_t | ecdsaGenerateSignature (const PrngAlgo *prngAlgo, void *prngContext, const EcDomainParameters *params, const EcPrivateKey *privateKey, const uint8_t *digest, size_t digestLen, EcdsaSignature *signature) |
ECDSA signature generation. More... | |
__weak_func error_t | ecdsaVerifySignature (const EcDomainParameters *params, const EcPublicKey *publicKey, const uint8_t *digest, size_t digestLen, const EcdsaSignature *signature) |
ECDSA signature verification. More... | |
Variables | |
const uint8_t | ECDSA_WITH_SHA1_OID [7] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x01} |
const uint8_t | ECDSA_WITH_SHA224_OID [8] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x01} |
const uint8_t | ECDSA_WITH_SHA256_OID [8] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02} |
const uint8_t | ECDSA_WITH_SHA384_OID [8] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x03} |
const uint8_t | ECDSA_WITH_SHA512_OID [8] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x04} |
const uint8_t | ECDSA_WITH_SHA3_224_OID [9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x09} |
const uint8_t | ECDSA_WITH_SHA3_256_OID [9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0A} |
const uint8_t | ECDSA_WITH_SHA3_384_OID [9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0B} |
const uint8_t | ECDSA_WITH_SHA3_512_OID [9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0C} |
Detailed Description
ECDSA (Elliptic 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.
- Version
- 2.4.4
Definition in file ecdsa.c.
Macro Definition Documentation
◆ TRACE_LEVEL
Function Documentation
◆ ecdsaFreeSignature()
void ecdsaFreeSignature | ( | EcdsaSignature * | signature | ) |
◆ ecdsaGenerateSignature()
__weak_func error_t ecdsaGenerateSignature | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
const EcDomainParameters * | params, | ||
const EcPrivateKey * | privateKey, | ||
const uint8_t * | digest, | ||
size_t | digestLen, | ||
EcdsaSignature * | signature | ||
) |
ECDSA signature generation.
- Parameters
-
[in] prngAlgo PRNG algorithm [in] prngContext Pointer to the PRNG context [in] params EC domain parameters [in] privateKey Signer's EC private key [in] digest Digest of the message to be signed [in] digestLen Length in octets of the digest [out] signature (R, S) integer pair
- Returns
- Error code
◆ ecdsaInitSignature()
void ecdsaInitSignature | ( | EcdsaSignature * | signature | ) |
◆ ecdsaReadSignature()
error_t ecdsaReadSignature | ( | const uint8_t * | data, |
size_t | length, | ||
EcdsaSignature * | signature | ||
) |
◆ ecdsaVerifySignature()
__weak_func error_t ecdsaVerifySignature | ( | const EcDomainParameters * | params, |
const EcPublicKey * | publicKey, | ||
const uint8_t * | digest, | ||
size_t | digestLen, | ||
const EcdsaSignature * | signature | ||
) |
ECDSA signature verification.
- Parameters
-
[in] params EC domain parameters [in] publicKey Signer's EC public key [in] digest Digest of the message whose signature is to be verified [in] digestLen Length in octets of the digest [in] signature (R, S) integer pair
- Returns
- Error code
◆ ecdsaWriteSignature()
error_t ecdsaWriteSignature | ( | const EcdsaSignature * | signature, |
uint8_t * | data, | ||
size_t * | length | ||
) |
Variable Documentation
◆ ECDSA_WITH_SHA1_OID
const uint8_t ECDSA_WITH_SHA1_OID[7] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x01} |
◆ ECDSA_WITH_SHA224_OID
const uint8_t ECDSA_WITH_SHA224_OID[8] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x01} |
◆ ECDSA_WITH_SHA256_OID
const uint8_t ECDSA_WITH_SHA256_OID[8] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02} |
◆ ECDSA_WITH_SHA384_OID
const uint8_t ECDSA_WITH_SHA384_OID[8] = {0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x03} |
◆ ECDSA_WITH_SHA3_224_OID
const uint8_t ECDSA_WITH_SHA3_224_OID[9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x09} |
◆ ECDSA_WITH_SHA3_256_OID
const uint8_t ECDSA_WITH_SHA3_256_OID[9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0A} |
◆ ECDSA_WITH_SHA3_384_OID
const uint8_t ECDSA_WITH_SHA3_384_OID[9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0B} |
◆ ECDSA_WITH_SHA3_512_OID
const uint8_t ECDSA_WITH_SHA3_512_OID[9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0C} |