i ended up writing my own. was a bit simpler:

https://github.com/damus-io/nostrdb/blob/74f31331e8f02aa7077d24c5110803499fb0c447/src/nip44.c

Reply to this note

Please Login to reply.

Discussion

are you suggesting I steel man noscrypt for you?

sure

I'll try my best with a few highlights I think are important.

As with all shared libraries noscrypt was intended to allow for the more flexibility in configuration and builds, while avoiding many assumptions.

- Devs can choose from a couple crypto libraries, such as mbedTLS, OpenSSL, or Windows BCrypt at the moment.

- Noscrypt does not allocate dynamic memory unless utils are used

- Noscrypt uses a crypto library abstraction which supports user overrides at a function level

- Does not expose any source of entropy/randomness, to avoid opinionated and "hard-coded defaults"

- All low-level apis are bring your own memory.

- Abstracts encryption/decryption to support both nip44 nip04 (incomplete) and future algorithms

- Does handle any character encoding/decoding (base64) yet, but may offer it as a utility

I also have a longer form blog I wrote last year in more detail. Essentially I didn't want to roll my own application specific crypto, with limited options and a highly specific use case for my NVault project.

https://www.vaughnnugent.com/blog/d9ab8a46cfa8d6bd59cf048fec8d73ffc44f881c

Noscrypt is excellent, I’ve been using it more and more whether it’s C or Zig projects. Highly recommend.