Fix copy/paste error that broke enctypes 6 and 7

This commit is contained in:
zzz
2025-04-15 16:24:51 -04:00
parent c1ca38dca2
commit 786ba8e190

View File

@ -68,9 +68,9 @@ class MLKEMDHState implements DHState, Cloneable {
if (patternId.equals(HandshakeState.PATTERN_ID_IKHFS_512)) {
type = isAlice ? EncType.MLKEM512_X25519_INT : EncType.MLKEM512_X25519_CT;
} else if (patternId.equals(HandshakeState.PATTERN_ID_IKHFS_768)) {
type = isAlice ? EncType.MLKEM768_X25519_INT : EncType.MLKEM512_X25519_CT;
type = isAlice ? EncType.MLKEM768_X25519_INT : EncType.MLKEM768_X25519_CT;
} else if (patternId.equals(HandshakeState.PATTERN_ID_IKHFS_1024)) {
type = isAlice ? EncType.MLKEM1024_X25519_INT : EncType.MLKEM512_X25519_CT;
type = isAlice ? EncType.MLKEM1024_X25519_INT : EncType.MLKEM1024_X25519_CT;
} else {
throw new IllegalArgumentException("Handshake pattern is not recognized");
}
@ -223,6 +223,8 @@ class MLKEMDHState implements DHState, Cloneable {
/**
* Side effect: If we are Bob, copies the ciphertext to our public key
* so it may be written out in the message.
*
* @throws IllegalArgumentException on bad public key modulus
*/
@Override
public void calculate(byte[] sharedKey, int offset, DHState publicDH) {