oscerd opened a new pull request, #29093:
URL: https://github.com/apache/camel/pull/29093

   ## Motivation
   
   `symmetricKeyLength` defaults to `128` on both the `pqc` component and the 
`pqc` data format.
   
   The default KEM is ML-KEM, whose default parameter set is ML-KEM-768 — NIST 
category 3, a 256-bit shared secret. Deriving a 128-bit symmetric key from it 
throws that margin away, and does not meet CNSA 2.0, which requires AES-256. 
The signature side already defaults consistently (`ml_dsa_65`), and the docs 
already use `symmetricKeyLength=256` in every example — the default was the 
outlier.
   
   ## Changes
   
   - `PQCConfiguration.symmetricKeyLength` and 
`PQCDataFormat.symmetricKeyLength` default to `256`, as does the `pqc` data 
format model. Catalog, schemas and DSL writers regenerated.
   - Docs: the data format option table and the option description state the 
new default and that the fixed-size ciphers only accept 128.
   - Upgrade guide entry for 4.24.
   
   ## Compatibility
   
   Two consequences, both in the upgrade guide:
   
   1. A key encapsulated with the new default cannot be used by a peer still on 
the old one, and data-format output is not interchangeable between versions. 
Mixed deployments must pin `symmetricKeyLength=128` on both ends during the 
rollover.
   2. The ciphers that cannot take a 256-bit key need the length set 
explicitly: `RC2` and `CAST5` (40, 64, 128), `DESEDE` (128, 192), `GRAIN128`, 
`HC128`, `SEED` and `SM4` (128 only). This is not a silent failure — the 
producer already validates the length against a per-algorithm table at route 
startup, so it fails fast with `Invalid symmetric key length 256 for algorithm 
SM4. Valid key lengths: [128]`. Conversely `CHACHA7539`, `GOST28147`, 
`GOST3412-2015` and `HC256` accept 256 only, and no longer need an explicit 
value — they were broken under the old default.
   
   ## Testing
   
   - New `PQCDefaultSymmetricKeyLengthTest`: asserts the default on both the 
component configuration and the data format, and that a KEM encapsulation 
performed with no explicit length yields a 32-byte key.
   - The round-trip tests for `SM4`, `CAST5`, `DESEDE` and `RC2` now pin the 
length those ciphers actually support, and the two KEM isolation tests, which 
built their control keys at 128 while the route used the default, now use 256 
on both sides.
   - Full `camel-pqc` suite: 327 tests, 0 failures. Full reactor build green.
   
   ---
   _Claude Code on behalf of @oscerd_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to