terl / lazysodium-java

A Java implementation of the Libsodium crypto library. For the lazy dev.

Home Page:https://github.com/terl/lazysodium-java/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signing multi-part messages (crypto_sign_init)

erikvanzijst opened this issue · comments

The crypto_sign_init/crypto_sign_update/crypto_sign_final_create methods seem to be missing from lazySodium, limiting it to signing files that fit into memory.

I'm looking for a Java/Scala libsodium layer to sign arbitrarily large binary files. Am I overlooking something, or is this part not yet exposed in lazySodium?

Perhaps I can pre-hash the files through crypto_generichash_* and then crypto_sign_detached the resulting 512 bit hash?

Hi @erikvanzijst, sure I can add them in for you and yes the multi part signing from Libsodium can do that, however it's always good to test your use-case out before. It may be that generhash may be the best way forward for your use-case.

Let me add those methods in a new release for you.

This was added through PR #67.

An example of how it works is in the test: SignTest.signLongMessage.

This is now available in release 4.2.5