swift-crypto icon indicating copy to clipboard operation
swift-crypto copied to clipboard

Make NIST `PublicKey`s conform to `Equatable`

Open Sajjon opened this issue 2 years ago • 1 comments

Make NIST PublicKey's (P256, P384 and P521) conform to Equatable

Checklist

  • [x] I've run tests to see all new and existing tests pass
  • [x] I've followed the code style of the rest of the project
  • [x] I've read the Contribution Guidelines
  • [x] I've updated the documentation if necessary

If you've made changes to gyb files

  • [x] I've run .script/generate_boilerplate_files_with_gyb and included updated generated files in a commit of this pull request

Motivation:

There is really no drawback in adding Equatable conformance, as argued in #173

Modifications:

  1. Make P256, P384 and P521's Signing and KeyAgreement PublicKey be Equatable, by...
  2. ... marking NISTECPublicKey to be Equatable and adding equals function in ECDH.swift.gyb
  3. Add tests for these.

Result:

ALL NIST PublicKey's now conform to Equatable

Sajjon avatar Apr 17 '23 10:04 Sajjon

As with #173, I'm marking this as Request Changes just as a visual note to myself to return to it.

Lukasa avatar Apr 17 '23 10:04 Lukasa