rust-hpke icon indicating copy to clipboard operation
rust-hpke copied to clipboard

Add missing k256 kat_tests

Open DanGould opened this issue 1 year ago • 1 comments

Known Answer Tests are missing in the original k256 implementation on the unstable-k256 branch.

There are a couple of things to solve in order to get them in here.

  1. The original test-vectors-5f503c5.json generated from the reference implementation do not include known answers for k256 since it is not defined in RFC 9080
  2. the k256 draft is missing test vectors for encryptions and exported values
  3. The draft test vectors seem to have errors. skRm and skSm are the identical but ikmS and ikmR from which they are derived (afaiu) are different as discussed in hpke-rs h/t @franziskuskiefer for discovering this.

I'm working on generating test vectors and having another implementation test them as well.

DanGould avatar Aug 11 '24 16:08 DanGould

I believe adding this test brings k256 up to feature parity with the others. Is anything else blocking it from being merged into main as a feature? Linking to the secp256k1 DHKEM author's note on why it probably will not make it into an RFC even though it's ready for action.

Eventually it's possible that IETF would publish the secp256k1-kem draft as an RFC, but as far as I can tell that's somewhat rarely done for things like this because the overhead of publishing RFCs is high and this has already been vetted by the original RFC's authors.

DanGould avatar Aug 13 '24 23:08 DanGould