cisco / go-hpke

Implementation of draft-irtf-cfrg-hpke
BSD 2-Clause "Simplified" License
30 stars 15 forks source link

Add private key serialization. #46

Closed chris-wood closed 1 year ago

chris-wood commented 3 years ago

cc @rozbb

rozbb commented 3 years ago

Also, it turns out that clamped scalars can never be 0 mod q. So clamping is sufficient and you don’t have to check anything

On Oct 23, 2020, at 19:54, Christopher Wood notifications@github.com wrote:

 @chris-wood commented on this pull request.

In crypto.go:

@@ -432,8 +461,14 @@ func (s x25519Scheme) DeserializePrivate(enc []byte) (KEMPrivateKey, error) { return nil, fmt.Errorf("Error deserializing X25519 private key") }

  • copied := clampX25519(enc)
  • var zero [32]byte
  • if subtle.ConstantTimeCompare(copied, zero[:]) == 1 { Yeah, since it's a SHOULD, I removed that check.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.