Skip to content

Commit

Permalink
PR comments; document obscure code implications
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel40791765 committed Oct 7, 2024
1 parent f9a36aa commit edc1a36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions crypto/fipsmodule/ec/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,9 @@ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ignored) {

// |a| and |b| are both custom curves. We compare the entire curve structure
// if both |a| and |b| are complete. If either are incomplete (due to legacy
// OpenSSL mistakes, custom curve construction is sadly done in two parts), we
// only compare the parts that are available.
// OpenSSL mistakes, custom curve construction is sadly done in two parts
// |EC_GROUP_new_curve_GFp| -> |EC_GROUP_set_generator|), we only compare
// the parts that are available.
if (a->has_order && b->has_order) {
return a->meth != b->meth || BN_cmp(&a->order.N, &b->order.N) != 0 ||
BN_cmp(&a->field.N, &b->field.N) != 0 ||
Expand Down
6 changes: 5 additions & 1 deletion crypto/fipsmodule/ec/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,11 @@ struct ec_group_st {
// comment is a human-readable string describing the curve.
const char *comment;

int curve_name; // optional NID for named curve
// curve_name is the optional NID for named curves. |oid| and |oid_len| are
// populated with values corresponding to the named curve's NID.
// |NID_undef| is used to imply that the curve is a custom explicit curve and
// the oid values are empty if so.
int curve_name;
uint8_t oid[9];
uint8_t oid_len;

Expand Down

0 comments on commit edc1a36

Please sign in to comment.