diff --git a/lib/rbnacl/nacl.rb b/lib/rbnacl/nacl.rb index efad014..7240448 100644 --- a/lib/rbnacl/nacl.rb +++ b/lib/rbnacl/nacl.rb @@ -118,11 +118,19 @@ def self.#{name}(*args) ONETIME_KEYBYTES = 32 ONETIME_BYTES = 16 + if NaCl.supported_version? :libsodium, '0.4.3' + crypto_onetimeauth_poly1305 = :crypto_onetimeauth_poly1305 + crypto_onetimeauth_poly1305_verify = :crypto_onetimeauth_poly1305_verify + else + crypto_onetimeauth_poly1305 = :crypto_onetimeauth_poly1305_ref + crypto_onetimeauth_poly1305_verify = :crypto_onetimeauth_poly1305_verify_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, diff --git a/lib/rbnacl/rake_tasks.rb b/lib/rbnacl/rake_tasks.rb index 17c2de2..553ff6f 100644 --- a/lib/rbnacl/rake_tasks.rb +++ b/lib/rbnacl/rake_tasks.rb @@ -3,8 +3,8 @@ require 'rake/clean' require 'digest/sha2' -LIBSODIUM_VERSION = "0.4.2" -LIBSODIUM_DIGEST = "1a7901cdd127471724e854a8eb478247dc0ca67be549345c75fc6f2d4e05ed39" +LIBSODIUM_VERSION = "0.4.3" +LIBSODIUM_DIGEST = "599ce19ae6ace2d30aee353b931088f720713c4e1d0b2918ed46de1914fb6042" def sh_hidden(command) STDERR.puts("*** Executing: #{command}")