Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Extra 2 bytes at the beginning of signature #13

Open
xucito opened this issue Nov 30, 2023 · 1 comment
Open

Extra 2 bytes at the beginning of signature #13

xucito opened this issue Nov 30, 2023 · 1 comment

Comments

@xucito
Copy link

xucito commented Nov 30, 2023

When signing detached, there are 2 more bytes at the beginning of the signature then what is expected.

https://openquantumsafe.org/liboqs/algorithms/sig/dilithium.html

There should be 4595 bytes

In the test below the sig is 4597 bytes

const test = async () => {
  const keyPair = await dilithium.keyPair();
  var sig = await dilithium.signDetached(Buffer.from("this is a test", 'utf8'), keyPair.privateKey)
  console.log(sig.length)
}

If the two bytes are trimmed, the signature is then verifiable by other implementations of dilithium.

@conradoGen
Copy link

did u check if the opposite works?
other implementation sign, this verify?

I tried to verify without the initial extra bytes and it failed to verify

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants