supranational / blst

Multilingual BLS12-381 signature library
Apache License 2.0
471 stars 177 forks source link

Error while performing signature #82

Closed Mario-DLH closed 3 years ago

Mario-DLH commented 3 years ago

We need to use blst in order to perform a signature in our project, but it fails using blst_sign_pk_in_g1 function, specifically in POINTonE2_mult_gls. It has been built using arm-none-eabi-gcc from GNU Arm Embedded Toolchain as cross compiler and it's used in a nRF5340 board. Last working version was this one.

dot-asm commented 3 years ago

Could you be more specific about how it fails? Does it fail to compile? Does it crash at run time? First thing that comes to mind is a compiler bug. And the usual way to test if we're looking at one is to drop the optimization level. Can you try that? There was modification to POINTonE2_mult_gls past the referred commit, but it's later, more specifically next to 9c5eddeed591f389c8c24dbf292780a3015b8c87...

dot-asm commented 3 years ago

Another ~possibility~ possible explanation is that latest POINTonE2_mult_gls is using more stack. Can this be a problem on your system?

Mario-DLH commented 3 years ago

Turns out it was a stack problem indeed. Thank you for your response and sorry for the inconveniences.

dot-asm commented 3 years ago

No problem. For my reference, how large did stack turn out to be on your platform? The POINTonE2_mult_gls wants +18KB for itself and I wonder what the total is.

Mario-DLH commented 3 years ago

I had to add about 6KB more (from 15 to 21). I don't know the exact amount as I tried increasing 1KB more each time.