-
Hello. Apologies if this is the wrong place to post; feel free to delete if so. I am unable to get BouncyCastle version 1.72 to verify digital signatures generated with the Falcon reference code at falcon-sign.info. I assume I am using the BouncyCastle Falcon code wrong in some way. Any help appreciated.
The following code is a JUnit test in Kotlin (should be able to drop into any Android app and then step through with debugger to see results).
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Before we do anything what reference implementation are you using? Does it produce the same output as the KAT files provided in the BC distribution for Falcon. Falcon's a bit of a weird one as the have a specific type byte for detached signatures, so that's usually one source of change, however there has been additional work on the algorithm since it was selected and I believe some of this was directed at the encoding formats. |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure that's the one we used. You'll find everything including the builder for the test vectors in https://falcon-sign.info/falcon-round3.zip - the submission package. It's dated the same though. |
Beta Was this translation helpful? Give feedback.
It looks like we're probably both looking at the same vectors. but I think there may be an issue with the byte[] conversion. I think you'd find this a lot easier if you left the data in Hex. It would be obvious that the first "026833" is actually "2907658" so the signature data is clearly incorrect.
https://github.com/bcgit/bc-java/blob/master/core/src/test/java/org/bouncycastle/pqc/crypto/test/FalconTest.java shows how we convert a detached signature into the format used in NIST files.