Skip to content

Commit

Permalink
Change testdata for Kyber keys and prepare for v6 PKESK
Browse files Browse the repository at this point in the history
  • Loading branch information
wussler committed May 15, 2023
1 parent f5e0443 commit 4d9ba00
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 35 deletions.
1 change: 1 addition & 0 deletions openpgp/packet/encrypted_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ func SerializeEncryptedKeyAEAD(w io.Writer, pub *PublicKey, cipherFunc CipherFun
return serializeEncryptedKeyX448(w, config.Random(), buf[:lenHeaderWritten], pub.PublicKey.(*x448.PublicKey), keyBlock, byte(cipherFunc), version)
case PubKeyAlgoKyber768X25519, PubKeyAlgoKyber1024X448, PubKeyAlgoKyber768P256, PubKeyAlgoKyber1024P384,
PubKeyAlgoKyber768Brainpool256, PubKeyAlgoKyber1024Brainpool384:
// TODO: check v6 PKESK
return serializeEncryptedKeyKyber(w, config.Random(), buf[:lenHeaderWritten], pub.PublicKey.(*kyber_ecdh.PublicKey), keyBlock, pub)
case PubKeyAlgoDSA, PubKeyAlgoRSASignOnly:
return errors.InvalidArgumentError("cannot encrypt to public key of type " + strconv.Itoa(int(pub.PubKeyAlgo)))
Expand Down
4 changes: 0 additions & 4 deletions openpgp/packet/public_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ func (pk *PublicKey) parseEdDSA(r io.Reader) (err error) {
return
}

<<<<<<< HEAD
func (pk *PublicKey) parseX25519(r io.Reader) (err error) {
point := make([]byte, x25519.PointSize)
_, err = io.ReadFull(r, point)
Expand Down Expand Up @@ -690,10 +689,7 @@ func (pk *PublicKey) parseEd448(r io.Reader) (err error) {
return
}

// parseKyberECDH parses a Dilithium + ECDSA public key as specified in
=======
// parseDilithiumECDSA parses a Dilithium + ECDSA public key as specified in
>>>>>>> bf54e14 (Add SPHINCS+ signature support)
// https://www.ietf.org/archive/id/draft-wussler-openpgp-pqc-00.html#section-5.3.2
func (pk *PublicKey) parseDilithiumECDSA(r io.Reader, ecLen, dLen int) (err error) {
pk.p = encoding.NewEmptyOctetArray(ecLen)
Expand Down
Loading

0 comments on commit 4d9ba00

Please sign in to comment.