Bouncy Castle fixes invalid-ciphertext handling in three NTRU-family KEMs
Bouncy Castle Java 1.87 fixes how SNTRU Prime and NTRU LPRime produce fallback secrets for rejected ciphertexts, and changes NTRU+ to signal rejection. These are distinct errors in how the library handled invalid inputs to decapsulation.
Broken implementation. The underlying math is not broken by this. The failure is in code, hardware, or how the primitive is used.
Background
Decapsulation uses a private key and a ciphertext to derive a shared secret. With implicit rejection, invalid ciphertexts also produce an output secret, derived along a fallback path. In SNTRU Prime and NTRU LPRime, Bouncy Castle used the re-encrypted value on that path, so different invalid inputs that decrypted to the same message received the same fallback secret. The vendor says version 1.87 preserves outputs for valid ciphertexts.
NTRU+ incorrectly returned a secret for rejected ciphertexts, either all zero or derived from the decrypted message. In version 1.87, extractSecret() throws for a rejected ciphertext and the implementation refuses non-canonical encodings.
Sources
- primary disclosureBouncy Castle Java 1.87 tagged release notesBouncy Castle, github.com
- primary disclosureBouncy Castle Java release downloads and notesBouncy Castle, bouncycastle.org