ctz / cifra

A collection of cryptographic primitives targeted at embedded use.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different values of "tag" in cifra and libsodium for the same function

monicaphalswal opened this issue · comments

same problem here

Could you post some code or test vectors?

I just tried:

key: 6b65792e6b65792e6b65792e6b65792e6b65792e6b65792e6b65792e6b65792e
nonce: 6e6f6e63652e6e6f6e63652e
aad: 616164
msg: 6d657373616765
cipher: 5d9c0a9fe7d5e5
tag: 2824af504fdce6e85fc9d80c7c2a9f38

And both libsodium/cifra agree. Cifra also passes the known answer tests in the RFC (though it's possible those are poorly designed and not exhaustive).

Actually, the test vectors from the RFC don't cover |aad| == 0, and cifra gets this case wrong. Fix incoming.

Fixed in b6cdf9f. Sorry for the inconvenience and thanks for the report.

Great!
Thank you! :)