@wishknish/knishio-client-ts 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23899,6 +23899,12 @@ ${operationTypes.join("\n")}
23899
23899
  const messageString = JSON.stringify(message);
23900
23900
  const messageUint8 = new TextEncoder().encode(messageString);
23901
23901
  const deserializedPubkey = this.deserializeKey(recipientPubkey);
23902
+ const ML_KEM_768_PUBLIC_KEY_BYTES = 1184;
23903
+ if (deserializedPubkey.length !== ML_KEM_768_PUBLIC_KEY_BYTES) {
23904
+ throw new Error(
23905
+ `KnishIO: cannot ML-KEM-encrypt \u2014 recipient public key is ${deserializedPubkey.length} bytes, expected ${ML_KEM_768_PUBLIC_KEY_BYTES} (ML-KEM-768). The node likely did not advertise an ML-KEM public key (upgrade the validator to a PQ-transport build), or authenticate with { encrypt: false }.`
23906
+ );
23907
+ }
23902
23908
  const { cipherText, sharedSecret } = ml_kem768.encapsulate(deserializedPubkey);
23903
23909
  const encryptedMessage = await this.encryptWithSharedSecret(messageUint8, sharedSecret);
23904
23910
  return {