Skip to content

Commit

Permalink
libsodium 0.4.3 support
Browse files Browse the repository at this point in the history
It appears there was a minor change in the ABI:

crypto_onetimeauth_poly1305_ref(_*) => crypto_onetimeauth_poly1305(_*)
  • Loading branch information
tarcieri committed Sep 10, 2013
1 parent ec625f5 commit 03cf046
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/rbnacl/nacl.rb
Expand Up @@ -118,11 +118,17 @@ def self.#{name}(*args)

ONETIME_KEYBYTES = 32
ONETIME_BYTES = 16
if NaCl.supported_version? :libsodium, '0.4.3'
crypto_onetimeauth_poly1305 = :crypto_onetimeauth_poly1305
else
crypto_onetimeauth_poly1305 = :crypto_onetimeauth_poly1305_ref
end

wrap_nacl_function :crypto_auth_onetime,
:crypto_onetimeauth_poly1305_ref,
:crypto_onetimeauth_poly1305,
[:pointer, :pointer, :long_long, :pointer]
wrap_nacl_function :crypto_auth_onetime_verify,
:crypto_onetimeauth_poly1305_ref_verify,
:crypto_onetimeauth_poly1305_verify,
[:pointer, :pointer, :long_long, :pointer]

wrap_nacl_function :random_bytes,
Expand Down

0 comments on commit 03cf046

Please sign in to comment.