sharplispers / ironclad

A cryptographic toolkit written in Common Lisp
BSD 3-Clause "New" or "Revised" License
166 stars 28 forks source link

Support for Schnorr signatures? #55

Closed aerique closed 1 year ago

aerique commented 1 year ago

Does Ironclad have support for Schnorr signatures?

Trivially grepping through the code and searching the repo suggests it does not. However I'm not well-versed in cryptography so maybe it goes by another name inside this package :shrug:

I'm playing around with Nostr and it looks like I need them: https://github.com/nbd-wtf/nostr-tools/blob/master/keys.ts#L8

When I go through this: https://github.com/nbd-wtf/nostr-tools/blob/master/keys.ts#L8 and duplicate it in CL I get a correct event hash using Ironclad but not a correct signature.

aerique commented 1 year ago

I've done a pretty straight translation from https://github.com/bitcoin/bips/blob/master/bip-0340/reference.py and it passes all the tests.

It can be found here: https://gist.github.com/aerique/0362a949ab4890d6b915300e14872a5a

I'll release it under the same license as Ironclad: BSD 3-Clause "New" or "Revised" License

I'm going to try and use it for Nostr now, so there'll probably be more revision :-D

It has only been tested with SBCL 2.3.2.

aerique commented 1 year ago

Oh sure, now I come across an implementation :sob:

https://github.com/akovalenko/bip0340

glv2 commented 1 year ago

Do you need some modifications in Ironclad, or can this issue be closed?

aerique commented 1 year ago

I'll close the issue.