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_SECP256R1)
24#if !defined(BOTAN_HAS_PCURVES_SECP384R1)
31#if !defined(BOTAN_HAS_PCURVES_SECP521R1)
38#if !defined(BOTAN_HAS_PCURVES_SECP256K1)
45#if !defined(BOTAN_HAS_PCURVES_BRAINPOOL256R1)
52#if !defined(BOTAN_HAS_PCURVES_BRAINPOOL384R1)
59#if !defined(BOTAN_HAS_PCURVES_BRAINPOOL512R1)
66#if !defined(BOTAN_HAS_PCURVES_FRP256V1)
73#if !defined(BOTAN_HAS_PCURVES_SM2P256V1)
119 switch(this->
code()) {
129 return "brainpool256r1";
131 return "brainpool384r1";
133 return "brainpool512r1";
145 if(
name ==
"secp256r1") {
147 }
else if(
name ==
"secp384r1") {
149 }
else if(
name ==
"secp521r1") {
151 }
else if(
name ==
"secp256k1") {
153 }
else if(
name ==
"brainpool256r1") {
155 }
else if(
name ==
"brainpool384r1") {
157 }
else if(
name ==
"brainpool512r1") {
159 }
else if(
name ==
"frp256v1") {
161 }
else if(
name ==
"sm2p256v1") {
168#if defined(BOTAN_HAS_ASN1)
171std::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 > secp256k1()
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 > 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)
@ 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)