potatosalad/ruby-jose

Consider x25519 and ed25519 gems as alternative to RbNaCl?

tarcieri opened this issue · 5 comments

Hello, I am the author of RbNaCl.

It looks like you're only using RbNaCl for X25519 and Ed25519. I have released gems which are much, much more lightweight dependencies than RbNaCl which implement these algorithms exactly for this type of usage pattern:

https://github.com/crypto-rb/x25519
https://github.com/crypto-rb/ed25519

These gems should install in seconds as opposed to the few minutes or so rbnacl-libsodium presently takes.

The x25519 gem provides the fastest X25519 implementation presently available for modern CPU architectures and falls back on the portable "ref10" implementation.

The ed25519 gem provides the "ref10" C implementation and a fast Java implementation on JRuby.

Unfortunately the x25519 gem does not provide a JRuby backend yet.

@tarcieri Awesome, thanks for the heads up. I'll take a look into this this week.

Released as part of jose 1.1.3

It looks like rbnacl-libsodium is still a dependency?
https://github.com/potatosalad/ruby-jose/blob/master/jose.gemspec#L36

@tarcieri Yeah, I kept support for RbNaCl as an optional dependency in case anyone was already dependent on it. I figured I could remove support on version 1.2.0 or something like that if needed.

If both RbNaCl and the Ed25519/X25519 libraries are found present, it will default to the latter.

@potatosalad aah cool... if there are issues with JRuby support for x25519 (ed25519 already supports it) I can add a JRuby backend for that.