zig icon indicating copy to clipboard operation
zig copied to clipboard

std.crypto: Add segmented API to Ed25519 signing.

Open gcoakes opened this issue 3 years ago • 1 comments

std.crypto.sign.Ed25519.sign previously required the message to be passed as a single continuous byte slice. This adds a second function std.crypto.sign.Ed25519.signSegmented which permits the message to be a slice of byte slices. The original sign function simply wraps the msg argument in a single item tuple and passes a slice of that to signSegmented.

gcoakes avatar Aug 07 '22 22:08 gcoakes

If such an interface is added, it should be done consistently, not just in one specific function: also for verification, for blind signatures, and other signature systems.

But a more generic approach would be to have alternative signature/verification functions requiring a Reader or a SeekableStream instead.

That would solve your issue, but also the ability to sign/verify anything that doesn't fit in memory.

By the way, the EdDSA API is going to be completely revamped in order to match the ECDSA one.

jedisct1 avatar Aug 07 '22 22:08 jedisct1

I'll re-open if/when the EdDSA API is restructured.

gcoakes avatar Sep 18 '22 19:09 gcoakes