7#include <botan/internal/pcurves.h>
9#include <botan/internal/pcurves_instance.h>
11#if defined(BOTAN_HAS_ASN1)
12 #include <botan/asn1_obj.h>
17#if !defined(BOTAN_HAS_PCURVES_SECP192R1)
24#if !defined(BOTAN_HAS_PCURVES_SECP224R1)
31#if !defined(BOTAN_HAS_PCURVES_SECP256R1)
38#if !defined(BOTAN_HAS_PCURVES_SECP384R1)
45#if !defined(BOTAN_HAS_PCURVES_SECP521R1)
52#if !defined(BOTAN_HAS_PCURVES_SECP256K1)
59#if !defined(BOTAN_HAS_PCURVES_BRAINPOOL256R1)
66#if !defined(BOTAN_HAS_PCURVES_BRAINPOOL384R1)
73#if !defined(BOTAN_HAS_PCURVES_BRAINPOOL512R1)
80#if !defined(BOTAN_HAS_PCURVES_FRP256V1)
87#if !defined(BOTAN_HAS_PCURVES_SM2P256V1)
94#if !defined(BOTAN_HAS_PCURVES_NUMSP512D1)
149 switch(this->
code()) {
163 return "brainpool256r1";
165 return "brainpool384r1";
167 return "brainpool512r1";
181 if(
name ==
"secp192r1") {
183 }
else if(
name ==
"secp224r1") {
185 }
else if(
name ==
"secp256r1") {
187 }
else if(
name ==
"secp384r1") {
189 }
else if(
name ==
"secp521r1") {
191 }
else if(
name ==
"secp256k1") {
193 }
else if(
name ==
"brainpool256r1") {
195 }
else if(
name ==
"brainpool384r1") {
197 }
else if(
name ==
"brainpool512r1") {
199 }
else if(
name ==
"frp256v1") {
201 }
else if(
name ==
"sm2p256v1") {
203 }
else if(
name ==
"numsp512d1") {
210#if defined(BOTAN_HAS_ASN1)
213std::optional<PrimeOrderCurveId> PrimeOrderCurveId::from_oid(
const OID& oid) {
std::string human_name_or_empty() const
static std::shared_ptr< const PrimeOrderCurve > secp521r1()
static std::shared_ptr< const PrimeOrderCurve > numsp512d1()
static std::shared_ptr< const PrimeOrderCurve > secp256k1()
static std::shared_ptr< const PrimeOrderCurve > secp192r1()
static std::shared_ptr< const PrimeOrderCurve > secp384r1()
static std::shared_ptr< const PrimeOrderCurve > brainpool384r1()
static std::shared_ptr< const PrimeOrderCurve > brainpool512r1()
static std::shared_ptr< const PrimeOrderCurve > secp224r1()
static std::shared_ptr< const PrimeOrderCurve > frp256v1()
static std::shared_ptr< const PrimeOrderCurve > brainpool256r1()
static std::shared_ptr< const PrimeOrderCurve > sm2p256v1()
static std::shared_ptr< const PrimeOrderCurve > secp256r1()
Identifier for a named prime order curve.
static std::vector< PrimeOrderCurveId > all()
static std::optional< PrimeOrderCurveId > from_string(std::string_view name)
Map a string to a curve identifier.
std::string to_string() const
Convert the ID to it's commonly used name (inverse of from_string)
@ secp192r1
secp192r1 aka P-192
@ secp224r1
secp224r1 aka P-224
@ secp384r1
secp384r1 aka P-384
@ secp256r1
secp256r1 aka P-256
@ brainpool256r1
brainpool256r1
@ secp521r1
secp521r1 aka P-521
static std::shared_ptr< const PrimeOrderCurve > from_id(PrimeOrderCurveId id)