Allow extended keys in BlowfishEngine for interoperability #519
+97
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #407, this is a proposal to support non-standard key sizes in the
BlowfishEngine, for interoperability with other cryptographic libraries like OpenSSL and Nettle.I want with an approach were by default, the key is still validated to be standard, but using the new
BlowfishParameters, it is possible to lift the check for the engine to handle extended keys. If a key exceeds 576 bits, only the first 576 bits of the data will be used to compute the P box. This is in line with the OpenSSL and Nettle implementations.I've generated test vectors using OpenSSL and Nettle. I couldn't find any online (even these libs do not seem to test larger keys):
test_vectors.cpp.txt