summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2025-03-09 17:53:11 +0000
committertb <>2025-03-09 17:53:11 +0000
commitb092f5153557a3783b8d50ed92da58a5a8abe942 (patch)
tree73f295a6aea913aa1a92b91157c471339235f2f2
parentf211b39af8e7fbfcac9781dc58fd9d2641629bd9 (diff)
downloadopenbsd-b092f5153557a3783b8d50ed92da58a5a8abe942.tar.gz
openbsd-b092f5153557a3783b8d50ed92da58a5a8abe942.tar.bz2
openbsd-b092f5153557a3783b8d50ed92da58a5a8abe942.zip
Disambiguate curve comments
There are three "X9.62 curve over a 239 bit prime field" and the Brainpool curves are a pair for each field size thanks to their characteristic twist. Just include the curve name for each of the curves. discussed with jsing
-rw-r--r--src/lib/libcrypto/ec/ec_curve.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/lib/libcrypto/ec/ec_curve.c b/src/lib/libcrypto/ec/ec_curve.c
index cbe113e361..a3ec2de7fb 100644
--- a/src/lib/libcrypto/ec/ec_curve.c
+++ b/src/lib/libcrypto/ec/ec_curve.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_curve.c,v 1.53 2024/12/24 18:33:24 tb Exp $ */ 1/* $OpenBSD: ec_curve.c,v 1.54 2025/03/09 17:53:11 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -1084,7 +1084,7 @@ static const struct ec_curve {
1084} ec_curve_list[] = { 1084} ec_curve_list[] = {
1085 /* secg curves */ 1085 /* secg curves */
1086 { 1086 {
1087 .comment = "SECG curve over a 224 bit prime field", 1087 .comment = "SECG curve secp224k1",
1088 .nid = NID_secp224k1, 1088 .nid = NID_secp224k1,
1089 .param_len = sizeof(_EC_SECG_PRIME_224K1.p), 1089 .param_len = sizeof(_EC_SECG_PRIME_224K1.p),
1090 .p = _EC_SECG_PRIME_224K1.p, 1090 .p = _EC_SECG_PRIME_224K1.p,
@@ -1096,7 +1096,7 @@ static const struct ec_curve {
1096 .cofactor = 1, 1096 .cofactor = 1,
1097 }, 1097 },
1098 { 1098 {
1099 .comment = "NIST/SECG curve over a 224 bit prime field", 1099 .comment = "NIST/SECG curve secp224r1",
1100 .nid = NID_secp224r1, 1100 .nid = NID_secp224r1,
1101 .seed_len = sizeof(_EC_NIST_PRIME_224.seed), 1101 .seed_len = sizeof(_EC_NIST_PRIME_224.seed),
1102 .param_len = sizeof(_EC_NIST_PRIME_224.p), 1102 .param_len = sizeof(_EC_NIST_PRIME_224.p),
@@ -1110,7 +1110,7 @@ static const struct ec_curve {
1110 .cofactor = 1, 1110 .cofactor = 1,
1111 }, 1111 },
1112 { 1112 {
1113 .comment = "SECG curve over a 256 bit prime field", 1113 .comment = "SECG curve secp256k1",
1114 .nid = NID_secp256k1, 1114 .nid = NID_secp256k1,
1115 .param_len = sizeof(_EC_SECG_PRIME_256K1.p), 1115 .param_len = sizeof(_EC_SECG_PRIME_256K1.p),
1116 .p = _EC_SECG_PRIME_256K1.p, 1116 .p = _EC_SECG_PRIME_256K1.p,
@@ -1123,7 +1123,7 @@ static const struct ec_curve {
1123 }, 1123 },
1124 /* SECG secp256r1 is the same as X9.62 prime256v1 and hence omitted */ 1124 /* SECG secp256r1 is the same as X9.62 prime256v1 and hence omitted */
1125 { 1125 {
1126 .comment = "NIST/SECG curve over a 384 bit prime field", 1126 .comment = "NIST/SECG curve secp384r1",
1127 .nid = NID_secp384r1, 1127 .nid = NID_secp384r1,
1128 .seed_len = sizeof(_EC_NIST_PRIME_384.seed), 1128 .seed_len = sizeof(_EC_NIST_PRIME_384.seed),
1129 .param_len = sizeof(_EC_NIST_PRIME_384.p), 1129 .param_len = sizeof(_EC_NIST_PRIME_384.p),
@@ -1137,7 +1137,7 @@ static const struct ec_curve {
1137 .cofactor = 1, 1137 .cofactor = 1,
1138 }, 1138 },
1139 { 1139 {
1140 .comment = "NIST/SECG curve over a 521 bit prime field", 1140 .comment = "NIST/SECG curve secp521r1",
1141 .nid = NID_secp521r1, 1141 .nid = NID_secp521r1,
1142 .seed_len = sizeof(_EC_NIST_PRIME_521.seed), 1142 .seed_len = sizeof(_EC_NIST_PRIME_521.seed),
1143 .param_len = sizeof(_EC_NIST_PRIME_521.p), 1143 .param_len = sizeof(_EC_NIST_PRIME_521.p),
@@ -1152,7 +1152,7 @@ static const struct ec_curve {
1152 }, 1152 },
1153 /* X9.62 curves */ 1153 /* X9.62 curves */
1154 { 1154 {
1155 .comment = "X9.62 curve over a 239 bit prime field", 1155 .comment = "X9.62 curve prime239v1",
1156 .nid = NID_X9_62_prime239v1, 1156 .nid = NID_X9_62_prime239v1,
1157 .seed_len = sizeof(_EC_X9_62_PRIME_239V1.seed), 1157 .seed_len = sizeof(_EC_X9_62_PRIME_239V1.seed),
1158 .param_len = sizeof(_EC_X9_62_PRIME_239V1.p), 1158 .param_len = sizeof(_EC_X9_62_PRIME_239V1.p),
@@ -1166,7 +1166,7 @@ static const struct ec_curve {
1166 .cofactor = 1, 1166 .cofactor = 1,
1167 }, 1167 },
1168 { 1168 {
1169 .comment = "X9.62 curve over a 239 bit prime field", 1169 .comment = "X9.62 curve prime239v2",
1170 .nid = NID_X9_62_prime239v2, 1170 .nid = NID_X9_62_prime239v2,
1171 .seed_len = sizeof(_EC_X9_62_PRIME_239V2.seed), 1171 .seed_len = sizeof(_EC_X9_62_PRIME_239V2.seed),
1172 .param_len = sizeof(_EC_X9_62_PRIME_239V2.p), 1172 .param_len = sizeof(_EC_X9_62_PRIME_239V2.p),
@@ -1180,7 +1180,7 @@ static const struct ec_curve {
1180 .cofactor = 1, 1180 .cofactor = 1,
1181 }, 1181 },
1182 { 1182 {
1183 .comment = "X9.62 curve over a 239 bit prime field", 1183 .comment = "X9.62 curve prime239v3",
1184 .nid = NID_X9_62_prime239v3, 1184 .nid = NID_X9_62_prime239v3,
1185 .seed_len = sizeof(_EC_X9_62_PRIME_239V3.seed), 1185 .seed_len = sizeof(_EC_X9_62_PRIME_239V3.seed),
1186 .param_len = sizeof(_EC_X9_62_PRIME_239V3.p), 1186 .param_len = sizeof(_EC_X9_62_PRIME_239V3.p),
@@ -1194,7 +1194,7 @@ static const struct ec_curve {
1194 .cofactor = 1, 1194 .cofactor = 1,
1195 }, 1195 },
1196 { 1196 {
1197 .comment = "X9.62/SECG curve over a 256 bit prime field", 1197 .comment = "X9.62/SECG curve prime256v1",
1198 .nid = NID_X9_62_prime256v1, 1198 .nid = NID_X9_62_prime256v1,
1199 .seed_len = sizeof(_EC_X9_62_PRIME_256V1.seed), 1199 .seed_len = sizeof(_EC_X9_62_PRIME_256V1.seed),
1200 .param_len = sizeof(_EC_X9_62_PRIME_256V1.p), 1200 .param_len = sizeof(_EC_X9_62_PRIME_256V1.p),
@@ -1209,7 +1209,7 @@ static const struct ec_curve {
1209 }, 1209 },
1210 /* RFC 5639 curves */ 1210 /* RFC 5639 curves */
1211 { 1211 {
1212 .comment = "RFC 5639 curve over a 224 bit prime field", 1212 .comment = "RFC 5639 curve brainpoolP224r1",
1213 .nid = NID_brainpoolP224r1, 1213 .nid = NID_brainpoolP224r1,
1214 .param_len = sizeof(_EC_brainpoolP224r1.p), 1214 .param_len = sizeof(_EC_brainpoolP224r1.p),
1215 .p = _EC_brainpoolP224r1.p, 1215 .p = _EC_brainpoolP224r1.p,
@@ -1221,7 +1221,7 @@ static const struct ec_curve {
1221 .cofactor = 1, 1221 .cofactor = 1,
1222 }, 1222 },
1223 { 1223 {
1224 .comment = "RFC 5639 curve over a 224 bit prime field", 1224 .comment = "RFC 5639 curve brainpoolP224r2",
1225 .nid = NID_brainpoolP224t1, 1225 .nid = NID_brainpoolP224t1,
1226 .param_len = sizeof(_EC_brainpoolP224t1.p), 1226 .param_len = sizeof(_EC_brainpoolP224t1.p),
1227 .p = _EC_brainpoolP224t1.p, 1227 .p = _EC_brainpoolP224t1.p,
@@ -1233,7 +1233,7 @@ static const struct ec_curve {
1233 .cofactor = 1, 1233 .cofactor = 1,
1234 }, 1234 },
1235 { 1235 {
1236 .comment = "RFC 5639 curve over a 256 bit prime field", 1236 .comment = "RFC 5639 curve brainpoolP256r1",
1237 .nid = NID_brainpoolP256r1, 1237 .nid = NID_brainpoolP256r1,
1238 .param_len = sizeof(_EC_brainpoolP256r1.p), 1238 .param_len = sizeof(_EC_brainpoolP256r1.p),
1239 .p = _EC_brainpoolP256r1.p, 1239 .p = _EC_brainpoolP256r1.p,
@@ -1245,7 +1245,7 @@ static const struct ec_curve {
1245 .cofactor = 1, 1245 .cofactor = 1,
1246 }, 1246 },
1247 { 1247 {
1248 .comment = "RFC 5639 curve over a 256 bit prime field", 1248 .comment = "RFC 5639 curve brainpoolP256t1",
1249 .nid = NID_brainpoolP256t1, 1249 .nid = NID_brainpoolP256t1,
1250 .param_len = sizeof(_EC_brainpoolP256t1.p), 1250 .param_len = sizeof(_EC_brainpoolP256t1.p),
1251 .p = _EC_brainpoolP256t1.p, 1251 .p = _EC_brainpoolP256t1.p,
@@ -1257,7 +1257,7 @@ static const struct ec_curve {
1257 .cofactor = 1, 1257 .cofactor = 1,
1258 }, 1258 },
1259 { 1259 {
1260 .comment = "RFC 5639 curve over a 320 bit prime field", 1260 .comment = "RFC 5639 curve brainpoolP320r1",
1261 .nid = NID_brainpoolP320r1, 1261 .nid = NID_brainpoolP320r1,
1262 .param_len = sizeof(_EC_brainpoolP320r1.p), 1262 .param_len = sizeof(_EC_brainpoolP320r1.p),
1263 .p = _EC_brainpoolP320r1.p, 1263 .p = _EC_brainpoolP320r1.p,
@@ -1269,7 +1269,7 @@ static const struct ec_curve {
1269 .cofactor = 1, 1269 .cofactor = 1,
1270 }, 1270 },
1271 { 1271 {
1272 .comment = "RFC 5639 curve over a 320 bit prime field", 1272 .comment = "RFC 5639 curve brainpoolP320t1",
1273 .nid = NID_brainpoolP320t1, 1273 .nid = NID_brainpoolP320t1,
1274 .param_len = sizeof(_EC_brainpoolP320t1.p), 1274 .param_len = sizeof(_EC_brainpoolP320t1.p),
1275 .p = _EC_brainpoolP320t1.p, 1275 .p = _EC_brainpoolP320t1.p,
@@ -1281,7 +1281,7 @@ static const struct ec_curve {
1281 .cofactor = 1, 1281 .cofactor = 1,
1282 }, 1282 },
1283 { 1283 {
1284 .comment = "RFC 5639 curve over a 384 bit prime field", 1284 .comment = "RFC 5639 curve brainpoolP384r1",
1285 .nid = NID_brainpoolP384r1, 1285 .nid = NID_brainpoolP384r1,
1286 .param_len = sizeof(_EC_brainpoolP384r1.p), 1286 .param_len = sizeof(_EC_brainpoolP384r1.p),
1287 .p = _EC_brainpoolP384r1.p, 1287 .p = _EC_brainpoolP384r1.p,
@@ -1293,7 +1293,7 @@ static const struct ec_curve {
1293 .cofactor = 1, 1293 .cofactor = 1,
1294 }, 1294 },
1295 { 1295 {
1296 .comment = "RFC 5639 curve over a 384 bit prime field", 1296 .comment = "RFC 5639 curve brainpoolP384t1",
1297 .nid = NID_brainpoolP384t1, 1297 .nid = NID_brainpoolP384t1,
1298 .param_len = sizeof(_EC_brainpoolP384t1.p), 1298 .param_len = sizeof(_EC_brainpoolP384t1.p),
1299 .p = _EC_brainpoolP384t1.p, 1299 .p = _EC_brainpoolP384t1.p,
@@ -1305,7 +1305,7 @@ static const struct ec_curve {
1305 .cofactor = 1, 1305 .cofactor = 1,
1306 }, 1306 },
1307 { 1307 {
1308 .comment = "RFC 5639 curve over a 512 bit prime field", 1308 .comment = "RFC 5639 curve brainpoolP512r1",
1309 .nid = NID_brainpoolP512r1, 1309 .nid = NID_brainpoolP512r1,
1310 .param_len = sizeof(_EC_brainpoolP512r1.p), 1310 .param_len = sizeof(_EC_brainpoolP512r1.p),
1311 .p = _EC_brainpoolP512r1.p, 1311 .p = _EC_brainpoolP512r1.p,
@@ -1317,7 +1317,7 @@ static const struct ec_curve {
1317 .cofactor = 1, 1317 .cofactor = 1,
1318 }, 1318 },
1319 { 1319 {
1320 .comment = "RFC 5639 curve over a 512 bit prime field", 1320 .comment = "RFC 5639 curve brainpoolP512t1",
1321 .nid = NID_brainpoolP512t1, 1321 .nid = NID_brainpoolP512t1,
1322 .param_len = sizeof(_EC_brainpoolP512t1.p), 1322 .param_len = sizeof(_EC_brainpoolP512t1.p),
1323 .p = _EC_brainpoolP512t1.p, 1323 .p = _EC_brainpoolP512t1.p,
@@ -1330,7 +1330,7 @@ static const struct ec_curve {
1330 }, 1330 },
1331 /* ANSSI */ 1331 /* ANSSI */
1332 { 1332 {
1333 .comment = "FRP256v1", 1333 .comment = "ANSSI curve FRP256v1",
1334 .nid = NID_FRP256v1, 1334 .nid = NID_FRP256v1,
1335 .param_len = sizeof(_EC_FRP256v1.p), 1335 .param_len = sizeof(_EC_FRP256v1.p),
1336 .p = _EC_FRP256v1.p, 1336 .p = _EC_FRP256v1.p,