-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rebis-dev: "[]" is not handled correctly #1215
Comments
I think this is a more general problem with how For example, I get with $ touch "[]" $ scryer-prolog ?- use_module(library(files)). true. ?- file_exists("[]"). false. % expected: true
|
This may be one of the simplest queries to test the issue: ?- Key = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], Nonce = [0,0,0,0,0,0,0,0,0,0,0,0], crypto_data_encrypt("[]", 'chacha20-poly1305', Key, Nonce, "", []). Since this unexpectedly succeeds, we see that the string |
… "") This addresses mthom#1215.
An even shorter query to test this: ?- crypto_data_hash("", A, []), crypto_data_hash("[]", B, []), dif(A, B). This query is expected to succeed. I have filed #1222 in an attempt to address this issue. |
This is now resolved, thank you a lot! |
Reviewing what I wrote in #1193 (comment), I noticed that
rebis-dev
in fact still contains a mistake in its handling of theaad/1
option!Specifically, we currently get on
rebis-dev
, for the query:The result:
Tag = [78,185,114,201,168,251,58,27,56,43,180,211,111,95,250,209]
, which is correct.However, if we specify for the
aad/1
option the string"[]"
, i.e., if we post:Then we get the same Tag as before, i.e.,
Tag = [78,185,114,201,168,251,58,27,56,43,180,211,111,95,250,209]
, which is incorrect! The correct result is:[129,92,253,207,2,86,106,239,60,201,211,254,151,176,184,80]
, which is whatmaster
yields.It is as if the string
"[]"
is not taken into account at all to compute the authenticator in therebis-dev
branch. Note that already a small change to the authenticated data is expected to effect a huge change in the tag. For example, if we use the string"["
as additional data:Then we get:
Tag = [160,214,128,75,75,133,105,42,194,18,70,151,67,32,242,183]
, which is correct, and completely different from the tag we get for""
even though only a single character was added.The text was updated successfully, but these errors were encountered: