Coverage Report

Created: 2026-06-08 07:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/botan/src/lib/math/pcurves/pcurves.cpp
Line
Count
Source
1
/*
2
* This file was automatically generated by ./src/scripts/dev_tools/gen_ec_groups.py on 2025-05-01
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6
7
#include <botan/internal/pcurves.h>
8
9
#include <botan/assert.h>
10
#include <botan/internal/pcurves_instance.h>
11
12
namespace Botan::PCurve {
13
14
//static
15
std::shared_ptr<const PrimeOrderCurve> PrimeOrderCurve::from_params(
16
20
   const BigInt& p, const BigInt& a, const BigInt& b, const BigInt& base_x, const BigInt& base_y, const BigInt& order) {
17
20
#if defined(BOTAN_HAS_PCURVES_GENERIC)
18
20
   return PCurveInstance::from_params(p, a, b, base_x, base_y, order);
19
0
#endif
20
21
0
   BOTAN_UNUSED(p, a, b, base_x, base_y, order);
22
0
   return {};
23
20
}
24
25
//static
26
27
std::shared_ptr<const PrimeOrderCurve> PrimeOrderCurve::for_named_curve(std::string_view name) {
27
27
#if defined(BOTAN_HAS_PCURVES_SECP256R1)
28
27
   if(name == "secp256r1") {
29
1
      return PCurveInstance::secp256r1();
30
1
   }
31
26
#endif
32
33
26
#if defined(BOTAN_HAS_PCURVES_SECP384R1)
34
26
   if(name == "secp384r1") {
35
1
      return PCurveInstance::secp384r1();
36
1
   }
37
25
#endif
38
39
25
#if defined(BOTAN_HAS_PCURVES_SECP521R1)
40
25
   if(name == "secp521r1") {
41
1
      return PCurveInstance::secp521r1();
42
1
   }
43
24
#endif
44
45
24
#if defined(BOTAN_HAS_PCURVES_BRAINPOOL256R1)
46
24
   if(name == "brainpool256r1") {
47
1
      return PCurveInstance::brainpool256r1();
48
1
   }
49
23
#endif
50
51
23
#if defined(BOTAN_HAS_PCURVES_BRAINPOOL384R1)
52
23
   if(name == "brainpool384r1") {
53
1
      return PCurveInstance::brainpool384r1();
54
1
   }
55
22
#endif
56
57
22
#if defined(BOTAN_HAS_PCURVES_BRAINPOOL512R1)
58
22
   if(name == "brainpool512r1") {
59
1
      return PCurveInstance::brainpool512r1();
60
1
   }
61
21
#endif
62
63
21
#if defined(BOTAN_HAS_PCURVES_FRP256V1)
64
21
   if(name == "frp256v1") {
65
1
      return PCurveInstance::frp256v1();
66
1
   }
67
20
#endif
68
69
20
#if defined(BOTAN_HAS_PCURVES_SECP192R1)
70
20
   if(name == "secp192r1") {
71
1
      return PCurveInstance::secp192r1();
72
1
   }
73
19
#endif
74
75
19
#if defined(BOTAN_HAS_PCURVES_SECP224R1)
76
19
   if(name == "secp224r1") {
77
1
      return PCurveInstance::secp224r1();
78
1
   }
79
18
#endif
80
81
18
#if defined(BOTAN_HAS_PCURVES_SECP256K1)
82
18
   if(name == "secp256k1") {
83
1
      return PCurveInstance::secp256k1();
84
1
   }
85
17
#endif
86
87
17
#if defined(BOTAN_HAS_PCURVES_SM2P256V1)
88
17
   if(name == "sm2p256v1") {
89
1
      return PCurveInstance::sm2p256v1();
90
1
   }
91
16
#endif
92
93
16
#if defined(BOTAN_HAS_PCURVES_NUMSP512D1)
94
16
   if(name == "numsp512d1") {
95
0
      return PCurveInstance::numsp512d1();
96
0
   }
97
16
#endif
98
99
16
   BOTAN_UNUSED(name);
100
16
   return {};
101
16
}
102
103
}  // namespace Botan::PCurve