ec_curves.h File Reference

Elliptic curves. More...

#include "core/crypto.h"
#include "mpi/mpi.h"

Go to the source code of this file.

Data Structures

struct  EcCurveInfo
 Elliptic curve parameters. More...
 

Macros

#define SECP112R1_SUPPORT   DISABLED
 
#define SECP112R2_SUPPORT   DISABLED
 
#define SECP128R1_SUPPORT   DISABLED
 
#define SECP128R2_SUPPORT   DISABLED
 
#define SECP160K1_SUPPORT   DISABLED
 
#define SECP160R1_SUPPORT   DISABLED
 
#define SECP160R2_SUPPORT   DISABLED
 
#define SECP192K1_SUPPORT   DISABLED
 
#define SECP192R1_SUPPORT   DISABLED
 
#define SECP224K1_SUPPORT   DISABLED
 
#define SECP224R1_SUPPORT   ENABLED
 
#define SECP256K1_SUPPORT   DISABLED
 
#define SECP256R1_SUPPORT   ENABLED
 
#define SECP384R1_SUPPORT   ENABLED
 
#define SECP521R1_SUPPORT   ENABLED
 
#define BRAINPOOLP160R1_SUPPORT   DISABLED
 
#define BRAINPOOLP192R1_SUPPORT   DISABLED
 
#define BRAINPOOLP224R1_SUPPORT   DISABLED
 
#define BRAINPOOLP256R1_SUPPORT   DISABLED
 
#define BRAINPOOLP320R1_SUPPORT   DISABLED
 
#define BRAINPOOLP384R1_SUPPORT   DISABLED
 
#define BRAINPOOLP512R1_SUPPORT   DISABLED
 
#define SM2_SUPPORT   DISABLED
 
#define X25519_SUPPORT   DISABLED
 
#define X448_SUPPORT   DISABLED
 
#define ED25519_SUPPORT   DISABLED
 
#define ED448_SUPPORT   DISABLED
 
#define SECP112R1_CURVE   (&secp112r1Curve)
 
#define SECP112R2_CURVE   (&secp112r2Curve)
 
#define SECP128R1_CURVE   (&secp128r1Curve)
 
#define SECP128R2_CURVE   (&secp128r2Curve)
 
#define SECP160K1_CURVE   (&secp160k1Curve)
 
#define SECP160R1_CURVE   (&secp160r1Curve)
 
#define SECP160R2_CURVE   (&secp160r2Curve)
 
#define SECP192K1_CURVE   (&secp192k1Curve)
 
#define SECP192R1_CURVE   (&secp192r1Curve)
 
#define SECP224K1_CURVE   (&secp224k1Curve)
 
#define SECP224R1_CURVE   (&secp224r1Curve)
 
#define SECP256K1_CURVE   (&secp256k1Curve)
 
#define SECP256R1_CURVE   (&secp256r1Curve)
 
#define SECP384R1_CURVE   (&secp384r1Curve)
 
#define SECP521R1_CURVE   (&secp521r1Curve)
 
#define BRAINPOOLP160R1_CURVE   (&brainpoolP160r1Curve)
 
#define BRAINPOOLP192R1_CURVE   (&brainpoolP192r1Curve)
 
#define BRAINPOOLP224R1_CURVE   (&brainpoolP224r1Curve)
 
#define BRAINPOOLP256R1_CURVE   (&brainpoolP256r1Curve)
 
#define BRAINPOOLP320R1_CURVE   (&brainpoolP320r1Curve)
 
#define BRAINPOOLP384R1_CURVE   (&brainpoolP384r1Curve)
 
#define BRAINPOOLP512R1_CURVE   (&brainpoolP512r1Curve)
 
#define SM2_CURVE   (&sm2Curve)
 
#define X25519_CURVE   (&x25519Curve)
 
#define X448_CURVE   (&x448Curve)
 
#define ED25519_CURVE   (&ed25519Curve)
 
#define ED448_CURVE   (&ed448Curve)
 

Typedefs

typedef error_t(* EcFastModAlgo) (Mpi *a, const Mpi *p)
 Fast modular reduction. More...
 

Enumerations

enum  EcCurveType {
  EC_CURVE_TYPE_NONE = 0 , EC_CURVE_TYPE_SECT_K1 = 1 , EC_CURVE_TYPE_SECT_R1 = 2 , EC_CURVE_TYPE_SECT_R2 = 3 ,
  EC_CURVE_TYPE_SECP_K1 = 4 , EC_CURVE_TYPE_SECP_R1 = 5 , EC_CURVE_TYPE_SECP_R2 = 6 , EC_CURVE_TYPE_BRAINPOOLP_R1 = 7 ,
  EC_CURVE_TYPE_X25519 = 8 , EC_CURVE_TYPE_X448 = 9 , EC_CURVE_TYPE_ED25519 = 10 , EC_CURVE_TYPE_ED448 = 11
}
 Elliptic curve type. More...
 

Functions

error_t secp128r1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp128r1 curve) More...
 
error_t secp128r2Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp128r2 curve) More...
 
error_t secp160k1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp160k1 curve) More...
 
error_t secp160r1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp160r1 curve) More...
 
error_t secp160r2Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp160r2 curve) More...
 
error_t secp192k1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp192k1 curve) More...
 
error_t secp192r1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp192r1 curve) More...
 
error_t secp224k1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp224k1 curve) More...
 
error_t secp224r1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp224r1 curve) More...
 
error_t secp256k1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp256k1 curve) More...
 
error_t secp256r1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp256r1 curve) More...
 
error_t secp384r1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp384r1 curve) More...
 
error_t secp521r1Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (secp521r1 curve) More...
 
error_t sm2Mod (Mpi *a, const Mpi *p)
 Fast modular reduction (SM2 curve) More...
 
const EcCurveInfoecGetCurveInfo (const uint8_t *oid, size_t length)
 Get the elliptic curve that matches the specified OID. More...
 

Variables

const uint8_t SECP112R1_OID [5]
 
const uint8_t SECP112R2_OID [5]
 
const uint8_t SECP128R1_OID [5]
 
const uint8_t SECP128R2_OID [5]
 
const uint8_t SECP160K1_OID [5]
 
const uint8_t SECP160R1_OID [5]
 
const uint8_t SECP160R2_OID [5]
 
const uint8_t SECP192K1_OID [5]
 
const uint8_t SECP192R1_OID [8]
 
const uint8_t SECP224K1_OID [5]
 
const uint8_t SECP224R1_OID [5]
 
const uint8_t SECP256K1_OID [5]
 
const uint8_t SECP256R1_OID [8]
 
const uint8_t SECP384R1_OID [5]
 
const uint8_t SECP521R1_OID [5]
 
const uint8_t BRAINPOOLP160R1_OID [9]
 
const uint8_t BRAINPOOLP192R1_OID [9]
 
const uint8_t BRAINPOOLP224R1_OID [9]
 
const uint8_t BRAINPOOLP256R1_OID [9]
 
const uint8_t BRAINPOOLP320R1_OID [9]
 
const uint8_t BRAINPOOLP384R1_OID [9]
 
const uint8_t BRAINPOOLP512R1_OID [9]
 
const uint8_t SM2_OID [8]
 
const uint8_t X25519_OID [3]
 
const uint8_t X448_OID [3]
 
const uint8_t ED25519_OID [3]
 
const uint8_t ED448_OID [3]
 
const EcCurveInfo secp112r1Curve
 secp112r1 elliptic curve More...
 
const EcCurveInfo secp112r2Curve
 secp112r2 elliptic curve More...
 
const EcCurveInfo secp128r1Curve
 secp128r1 elliptic curve More...
 
const EcCurveInfo secp128r2Curve
 secp128r2 elliptic curve More...
 
const EcCurveInfo secp160k1Curve
 secp160k1 elliptic curve More...
 
const EcCurveInfo secp160r1Curve
 secp160r1 elliptic curve More...
 
const EcCurveInfo secp160r2Curve
 secp160r2 elliptic curve More...
 
const EcCurveInfo secp192k1Curve
 secp192k1 elliptic curve More...
 
const EcCurveInfo secp192r1Curve
 secp192r1 elliptic curve More...
 
const EcCurveInfo secp224k1Curve
 secp224k1 elliptic curve More...
 
const EcCurveInfo secp224r1Curve
 secp224r1 elliptic curve More...
 
const EcCurveInfo secp256k1Curve
 secp256k1 elliptic curve More...
 
const EcCurveInfo secp256r1Curve
 secp256r1 elliptic curve More...
 
const EcCurveInfo secp384r1Curve
 secp384r1 elliptic curve More...
 
const EcCurveInfo secp521r1Curve
 secp521r1 elliptic curve More...
 
const EcCurveInfo brainpoolP160r1Curve
 brainpoolP160r1 elliptic curve More...
 
const EcCurveInfo brainpoolP192r1Curve
 brainpoolP192r1 elliptic curve More...
 
const EcCurveInfo brainpoolP224r1Curve
 brainpoolP224r1 elliptic curve More...
 
const EcCurveInfo brainpoolP256r1Curve
 brainpoolP256r1 elliptic curve More...
 
const EcCurveInfo brainpoolP320r1Curve
 brainpoolP320r1 elliptic curve More...
 
const EcCurveInfo brainpoolP384r1Curve
 brainpoolP384r1 elliptic curve More...
 
const EcCurveInfo brainpoolP512r1Curve
 brainpoolP512r1 elliptic curve More...
 
const EcCurveInfo sm2Curve
 SM2 elliptic curve. More...
 
const EcCurveInfo x25519Curve
 Curve25519 elliptic curve. More...
 
const EcCurveInfo x448Curve
 Curve448 elliptic curve. More...
 
const EcCurveInfo ed25519Curve
 Ed25519 elliptic curve. More...
 
const EcCurveInfo ed448Curve
 Ed448 elliptic curve. More...
 

Detailed Description

Elliptic curves.

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 ec_curves.h.

Macro Definition Documentation

◆ BRAINPOOLP160R1_CURVE

#define BRAINPOOLP160R1_CURVE   (&brainpoolP160r1Curve)

Definition at line 243 of file ec_curves.h.

◆ BRAINPOOLP160R1_SUPPORT

#define BRAINPOOLP160R1_SUPPORT   DISABLED

Definition at line 145 of file ec_curves.h.

◆ BRAINPOOLP192R1_CURVE

#define BRAINPOOLP192R1_CURVE   (&brainpoolP192r1Curve)

Definition at line 244 of file ec_curves.h.

◆ BRAINPOOLP192R1_SUPPORT

#define BRAINPOOLP192R1_SUPPORT   DISABLED

Definition at line 152 of file ec_curves.h.

◆ BRAINPOOLP224R1_CURVE

#define BRAINPOOLP224R1_CURVE   (&brainpoolP224r1Curve)

Definition at line 245 of file ec_curves.h.

◆ BRAINPOOLP224R1_SUPPORT

#define BRAINPOOLP224R1_SUPPORT   DISABLED

Definition at line 159 of file ec_curves.h.

◆ BRAINPOOLP256R1_CURVE

#define BRAINPOOLP256R1_CURVE   (&brainpoolP256r1Curve)

Definition at line 246 of file ec_curves.h.

◆ BRAINPOOLP256R1_SUPPORT

#define BRAINPOOLP256R1_SUPPORT   DISABLED

Definition at line 166 of file ec_curves.h.

◆ BRAINPOOLP320R1_CURVE

#define BRAINPOOLP320R1_CURVE   (&brainpoolP320r1Curve)

Definition at line 247 of file ec_curves.h.

◆ BRAINPOOLP320R1_SUPPORT

#define BRAINPOOLP320R1_SUPPORT   DISABLED

Definition at line 173 of file ec_curves.h.

◆ BRAINPOOLP384R1_CURVE

#define BRAINPOOLP384R1_CURVE   (&brainpoolP384r1Curve)

Definition at line 248 of file ec_curves.h.

◆ BRAINPOOLP384R1_SUPPORT

#define BRAINPOOLP384R1_SUPPORT   DISABLED

Definition at line 180 of file ec_curves.h.

◆ BRAINPOOLP512R1_CURVE

#define BRAINPOOLP512R1_CURVE   (&brainpoolP512r1Curve)

Definition at line 249 of file ec_curves.h.

◆ BRAINPOOLP512R1_SUPPORT

#define BRAINPOOLP512R1_SUPPORT   DISABLED

Definition at line 187 of file ec_curves.h.

◆ ED25519_CURVE

#define ED25519_CURVE   (&ed25519Curve)

Definition at line 253 of file ec_curves.h.

◆ ED25519_SUPPORT

#define ED25519_SUPPORT   DISABLED

Definition at line 215 of file ec_curves.h.

◆ ED448_CURVE

#define ED448_CURVE   (&ed448Curve)

Definition at line 254 of file ec_curves.h.

◆ ED448_SUPPORT

#define ED448_SUPPORT   DISABLED

Definition at line 222 of file ec_curves.h.

◆ SECP112R1_CURVE

#define SECP112R1_CURVE   (&secp112r1Curve)

Definition at line 228 of file ec_curves.h.

◆ SECP112R1_SUPPORT

#define SECP112R1_SUPPORT   DISABLED

Definition at line 40 of file ec_curves.h.

◆ SECP112R2_CURVE

#define SECP112R2_CURVE   (&secp112r2Curve)

Definition at line 229 of file ec_curves.h.

◆ SECP112R2_SUPPORT

#define SECP112R2_SUPPORT   DISABLED

Definition at line 47 of file ec_curves.h.

◆ SECP128R1_CURVE

#define SECP128R1_CURVE   (&secp128r1Curve)

Definition at line 230 of file ec_curves.h.

◆ SECP128R1_SUPPORT

#define SECP128R1_SUPPORT   DISABLED

Definition at line 54 of file ec_curves.h.

◆ SECP128R2_CURVE

#define SECP128R2_CURVE   (&secp128r2Curve)

Definition at line 231 of file ec_curves.h.

◆ SECP128R2_SUPPORT

#define SECP128R2_SUPPORT   DISABLED

Definition at line 61 of file ec_curves.h.

◆ SECP160K1_CURVE

#define SECP160K1_CURVE   (&secp160k1Curve)

Definition at line 232 of file ec_curves.h.

◆ SECP160K1_SUPPORT

#define SECP160K1_SUPPORT   DISABLED

Definition at line 68 of file ec_curves.h.

◆ SECP160R1_CURVE

#define SECP160R1_CURVE   (&secp160r1Curve)

Definition at line 233 of file ec_curves.h.

◆ SECP160R1_SUPPORT

#define SECP160R1_SUPPORT   DISABLED

Definition at line 75 of file ec_curves.h.

◆ SECP160R2_CURVE

#define SECP160R2_CURVE   (&secp160r2Curve)

Definition at line 234 of file ec_curves.h.

◆ SECP160R2_SUPPORT

#define SECP160R2_SUPPORT   DISABLED

Definition at line 82 of file ec_curves.h.

◆ SECP192K1_CURVE

#define SECP192K1_CURVE   (&secp192k1Curve)

Definition at line 235 of file ec_curves.h.

◆ SECP192K1_SUPPORT

#define SECP192K1_SUPPORT   DISABLED

Definition at line 89 of file ec_curves.h.

◆ SECP192R1_CURVE

#define SECP192R1_CURVE   (&secp192r1Curve)

Definition at line 236 of file ec_curves.h.

◆ SECP192R1_SUPPORT

#define SECP192R1_SUPPORT   DISABLED

Definition at line 96 of file ec_curves.h.

◆ SECP224K1_CURVE

#define SECP224K1_CURVE   (&secp224k1Curve)

Definition at line 237 of file ec_curves.h.

◆ SECP224K1_SUPPORT

#define SECP224K1_SUPPORT   DISABLED

Definition at line 103 of file ec_curves.h.

◆ SECP224R1_CURVE

#define SECP224R1_CURVE   (&secp224r1Curve)

Definition at line 238 of file ec_curves.h.

◆ SECP224R1_SUPPORT

#define SECP224R1_SUPPORT   ENABLED

Definition at line 110 of file ec_curves.h.

◆ SECP256K1_CURVE

#define SECP256K1_CURVE   (&secp256k1Curve)

Definition at line 239 of file ec_curves.h.

◆ SECP256K1_SUPPORT

#define SECP256K1_SUPPORT   DISABLED

Definition at line 117 of file ec_curves.h.

◆ SECP256R1_CURVE

#define SECP256R1_CURVE   (&secp256r1Curve)

Definition at line 240 of file ec_curves.h.

◆ SECP256R1_SUPPORT

#define SECP256R1_SUPPORT   ENABLED

Definition at line 124 of file ec_curves.h.

◆ SECP384R1_CURVE

#define SECP384R1_CURVE   (&secp384r1Curve)

Definition at line 241 of file ec_curves.h.

◆ SECP384R1_SUPPORT

#define SECP384R1_SUPPORT   ENABLED

Definition at line 131 of file ec_curves.h.

◆ SECP521R1_CURVE

#define SECP521R1_CURVE   (&secp521r1Curve)

Definition at line 242 of file ec_curves.h.

◆ SECP521R1_SUPPORT

#define SECP521R1_SUPPORT   ENABLED

Definition at line 138 of file ec_curves.h.

◆ SM2_CURVE

#define SM2_CURVE   (&sm2Curve)

Definition at line 250 of file ec_curves.h.

◆ SM2_SUPPORT

#define SM2_SUPPORT   DISABLED

Definition at line 194 of file ec_curves.h.

◆ X25519_CURVE

#define X25519_CURVE   (&x25519Curve)

Definition at line 251 of file ec_curves.h.

◆ X25519_SUPPORT

#define X25519_SUPPORT   DISABLED

Definition at line 201 of file ec_curves.h.

◆ X448_CURVE

#define X448_CURVE   (&x448Curve)

Definition at line 252 of file ec_curves.h.

◆ X448_SUPPORT

#define X448_SUPPORT   DISABLED

Definition at line 208 of file ec_curves.h.

Typedef Documentation

◆ EcFastModAlgo

typedef error_t(* EcFastModAlgo) (Mpi *a, const Mpi *p)

Fast modular reduction.

Definition at line 287 of file ec_curves.h.

Enumeration Type Documentation

◆ EcCurveType

Elliptic curve type.

Enumerator
EC_CURVE_TYPE_NONE 
EC_CURVE_TYPE_SECT_K1 
EC_CURVE_TYPE_SECT_R1 
EC_CURVE_TYPE_SECT_R2 
EC_CURVE_TYPE_SECP_K1 
EC_CURVE_TYPE_SECP_R1 
EC_CURVE_TYPE_SECP_R2 
EC_CURVE_TYPE_BRAINPOOLP_R1 
EC_CURVE_TYPE_X25519 
EC_CURVE_TYPE_X448 
EC_CURVE_TYPE_ED25519 
EC_CURVE_TYPE_ED448 

Definition at line 266 of file ec_curves.h.

Function Documentation

◆ ecGetCurveInfo()

const EcCurveInfo* ecGetCurveInfo ( const uint8_t *  oid,
size_t  length 
)

Get the elliptic curve that matches the specified OID.

Parameters
[in]oidObject identifier
[in]lengthOID length
Returns
Elliptic curve domain parameters

Definition at line 2374 of file ec_curves.c.

◆ secp128r1Mod()

error_t secp128r1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp128r1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1402 of file ec_curves.c.

◆ secp128r2Mod()

error_t secp128r2Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp128r2 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1450 of file ec_curves.c.

◆ secp160k1Mod()

error_t secp160k1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp160k1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1498 of file ec_curves.c.

◆ secp160r1Mod()

error_t secp160r1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp160r1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1549 of file ec_curves.c.

◆ secp160r2Mod()

error_t secp160r2Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp160r2 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1597 of file ec_curves.c.

◆ secp192k1Mod()

error_t secp192k1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp192k1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1648 of file ec_curves.c.

◆ secp192r1Mod()

error_t secp192r1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp192r1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1699 of file ec_curves.c.

◆ secp224k1Mod()

error_t secp224k1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp224k1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1766 of file ec_curves.c.

◆ secp224r1Mod()

error_t secp224r1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp224r1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1817 of file ec_curves.c.

◆ secp256k1Mod()

error_t secp256k1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp256k1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1892 of file ec_curves.c.

◆ secp256r1Mod()

error_t secp256r1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp256r1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 1943 of file ec_curves.c.

◆ secp384r1Mod()

error_t secp384r1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp384r1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 2059 of file ec_curves.c.

◆ secp521r1Mod()

error_t secp521r1Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (secp521r1 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 2174 of file ec_curves.c.

◆ sm2Mod()

error_t sm2Mod ( Mpi a,
const Mpi p 
)

Fast modular reduction (SM2 curve)

Parameters
[in,out]aThis function accept an integer less than p^2 as input and return (a mod p) as output
[in]pPrime modulus

Definition at line 2220 of file ec_curves.c.

Variable Documentation

◆ BRAINPOOLP160R1_OID

const uint8_t BRAINPOOLP160R1_OID[9]
extern

Definition at line 78 of file ec_curves.c.

◆ brainpoolP160r1Curve

const EcCurveInfo brainpoolP160r1Curve
extern

brainpoolP160r1 elliptic curve

Definition at line 799 of file ec_curves.c.

◆ BRAINPOOLP192R1_OID

const uint8_t BRAINPOOLP192R1_OID[9]
extern

Definition at line 80 of file ec_curves.c.

◆ brainpoolP192r1Curve

const EcCurveInfo brainpoolP192r1Curve
extern

brainpoolP192r1 elliptic curve

Definition at line 845 of file ec_curves.c.

◆ BRAINPOOLP224R1_OID

const uint8_t BRAINPOOLP224R1_OID[9]
extern

Definition at line 82 of file ec_curves.c.

◆ brainpoolP224r1Curve

const EcCurveInfo brainpoolP224r1Curve
extern

brainpoolP224r1 elliptic curve

Definition at line 891 of file ec_curves.c.

◆ BRAINPOOLP256R1_OID

const uint8_t BRAINPOOLP256R1_OID[9]
extern

Definition at line 84 of file ec_curves.c.

◆ brainpoolP256r1Curve

const EcCurveInfo brainpoolP256r1Curve
extern

brainpoolP256r1 elliptic curve

Definition at line 937 of file ec_curves.c.

◆ BRAINPOOLP320R1_OID

const uint8_t BRAINPOOLP320R1_OID[9]
extern

Definition at line 86 of file ec_curves.c.

◆ brainpoolP320r1Curve

const EcCurveInfo brainpoolP320r1Curve
extern

brainpoolP320r1 elliptic curve

Definition at line 983 of file ec_curves.c.

◆ BRAINPOOLP384R1_OID

const uint8_t BRAINPOOLP384R1_OID[9]
extern

Definition at line 88 of file ec_curves.c.

◆ brainpoolP384r1Curve

const EcCurveInfo brainpoolP384r1Curve
extern

brainpoolP384r1 elliptic curve

Definition at line 1035 of file ec_curves.c.

◆ BRAINPOOLP512R1_OID

const uint8_t BRAINPOOLP512R1_OID[9]
extern

Definition at line 90 of file ec_curves.c.

◆ brainpoolP512r1Curve

const EcCurveInfo brainpoolP512r1Curve
extern

brainpoolP512r1 elliptic curve

Definition at line 1087 of file ec_curves.c.

◆ ED25519_OID

const uint8_t ED25519_OID[3]
extern

Definition at line 98 of file ec_curves.c.

◆ ed25519Curve

const EcCurveInfo ed25519Curve
extern

Ed25519 elliptic curve.

Definition at line 1295 of file ec_curves.c.

◆ ED448_OID

const uint8_t ED448_OID[3]
extern

Definition at line 100 of file ec_curves.c.

◆ ed448Curve

const EcCurveInfo ed448Curve
extern

Ed448 elliptic curve.

Definition at line 1341 of file ec_curves.c.

◆ SECP112R1_OID

const uint8_t SECP112R1_OID[5]
extern

Definition at line 48 of file ec_curves.c.

◆ secp112r1Curve

const EcCurveInfo secp112r1Curve
extern

secp112r1 elliptic curve

Definition at line 109 of file ec_curves.c.

◆ SECP112R2_OID

const uint8_t SECP112R2_OID[5]
extern

Definition at line 50 of file ec_curves.c.

◆ secp112r2Curve

const EcCurveInfo secp112r2Curve
extern

secp112r2 elliptic curve

Definition at line 149 of file ec_curves.c.

◆ SECP128R1_OID

const uint8_t SECP128R1_OID[5]
extern

Definition at line 52 of file ec_curves.c.

◆ secp128r1Curve

const EcCurveInfo secp128r1Curve
extern

secp128r1 elliptic curve

Definition at line 189 of file ec_curves.c.

◆ SECP128R2_OID

const uint8_t SECP128R2_OID[5]
extern

Definition at line 54 of file ec_curves.c.

◆ secp128r2Curve

const EcCurveInfo secp128r2Curve
extern

secp128r2 elliptic curve

Definition at line 229 of file ec_curves.c.

◆ SECP160K1_OID

const uint8_t SECP160K1_OID[5]
extern

Definition at line 56 of file ec_curves.c.

◆ secp160k1Curve

const EcCurveInfo secp160k1Curve
extern

secp160k1 elliptic curve

Definition at line 269 of file ec_curves.c.

◆ SECP160R1_OID

const uint8_t SECP160R1_OID[5]
extern

Definition at line 58 of file ec_curves.c.

◆ secp160r1Curve

const EcCurveInfo secp160r1Curve
extern

secp160r1 elliptic curve

Definition at line 315 of file ec_curves.c.

◆ SECP160R2_OID

const uint8_t SECP160R2_OID[5]
extern

Definition at line 60 of file ec_curves.c.

◆ secp160r2Curve

const EcCurveInfo secp160r2Curve
extern

secp160r2 elliptic curve

Definition at line 361 of file ec_curves.c.

◆ SECP192K1_OID

const uint8_t SECP192K1_OID[5]
extern

Definition at line 62 of file ec_curves.c.

◆ secp192k1Curve

const EcCurveInfo secp192k1Curve
extern

secp192k1 elliptic curve

Definition at line 407 of file ec_curves.c.

◆ SECP192R1_OID

const uint8_t SECP192R1_OID[8]
extern

Definition at line 64 of file ec_curves.c.

◆ secp192r1Curve

const EcCurveInfo secp192r1Curve
extern

secp192r1 elliptic curve

Definition at line 453 of file ec_curves.c.

◆ SECP224K1_OID

const uint8_t SECP224K1_OID[5]
extern

Definition at line 66 of file ec_curves.c.

◆ secp224k1Curve

const EcCurveInfo secp224k1Curve
extern

secp224k1 elliptic curve

Definition at line 499 of file ec_curves.c.

◆ SECP224R1_OID

const uint8_t SECP224R1_OID[5]
extern

Definition at line 68 of file ec_curves.c.

◆ secp224r1Curve

const EcCurveInfo secp224r1Curve
extern

secp224r1 elliptic curve

Definition at line 545 of file ec_curves.c.

◆ SECP256K1_OID

const uint8_t SECP256K1_OID[5]
extern

Definition at line 70 of file ec_curves.c.

◆ secp256k1Curve

const EcCurveInfo secp256k1Curve
extern

secp256k1 elliptic curve

Definition at line 591 of file ec_curves.c.

◆ SECP256R1_OID

const uint8_t SECP256R1_OID[8]
extern

Definition at line 72 of file ec_curves.c.

◆ secp256r1Curve

const EcCurveInfo secp256r1Curve
extern

secp256r1 elliptic curve

Definition at line 637 of file ec_curves.c.

◆ SECP384R1_OID

const uint8_t SECP384R1_OID[5]
extern

Definition at line 74 of file ec_curves.c.

◆ secp384r1Curve

const EcCurveInfo secp384r1Curve
extern

secp384r1 elliptic curve

Definition at line 683 of file ec_curves.c.

◆ SECP521R1_OID

const uint8_t SECP521R1_OID[5]
extern

Definition at line 76 of file ec_curves.c.

◆ secp521r1Curve

const EcCurveInfo secp521r1Curve
extern

secp521r1 elliptic curve

Definition at line 735 of file ec_curves.c.

◆ SM2_OID

const uint8_t SM2_OID[8]
extern

Definition at line 92 of file ec_curves.c.

◆ sm2Curve

const EcCurveInfo sm2Curve
extern

SM2 elliptic curve.

Definition at line 1145 of file ec_curves.c.

◆ X25519_OID

const uint8_t X25519_OID[3]
extern

Definition at line 94 of file ec_curves.c.

◆ x25519Curve

const EcCurveInfo x25519Curve
extern

Curve25519 elliptic curve.

Definition at line 1191 of file ec_curves.c.

◆ X448_OID

const uint8_t X448_OID[3]
extern

Definition at line 96 of file ec_curves.c.

◆ x448Curve

const EcCurveInfo x448Curve
extern

Curve448 elliptic curve.

Definition at line 1237 of file ec_curves.c.