fix: default salt encoding to 1AAH like signify-ts#143
Merged
Conversation
Signed-off-by: Kent Bull <kent@kentbull.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
My W3C crosswalk work surfaced an interesting bug in SignifyPy regarding salt encryption (SaltyKeeper.params.sxlt).
Background
SignifyTS was always using 1AAH, the X25519_Cipher_Salt, a fixed size salt cipher, and thusly never had to worry about variable size cipher salts like 4C / X25519_Cipher_L0, a variable X25519 salt cipher. So, the implicit rule for Encrypter.encrypt() in SignifyTS was that everything used 1AAH / X25519_Cipher_Salt by default.
Problem
Yet SignifyPy had a different default. This is due to KERIpy's default in Encrypter.encrypt() having the default set as so:
which meant that SignifyPy's default for salt encryption was
4C, not1AAH.I hit this sometime between 11:30 PM and 12:30 AM on Tuesday night of IIW last week trying to get the demo working and since I had not yet figured this out then I just added variable size code support to SignifyTS' Matter._exfil and Matter._infil, which meant a few code table entries got added in including the 4C ..._L0 code X25519_Cipher_L0. This was the wrong solution and I am backing those changes out. The right solution is below.
Fix
The fix is simple. Inside of SignifyPy the calls to Encrypter.encrypt() just need an explicit code specified that lines up with the SignifyTS default: X25519_Cipher_Salt.