lib/rbnacl/one_time_auths/poly1305.rb in rbnacl-3.1.2 vs lib/rbnacl/one_time_auths/poly1305.rb in rbnacl-3.2.0

- old
+ new

@@ -18,30 +18,30 @@ # # @see http://nacl.cr.yp.to/onetimeauth.html class Poly1305 < Auth extend Sodium - sodium_type :onetimeauth + sodium_type :onetimeauth sodium_primitive :poly1305 - sodium_constant :BYTES - sodium_constant :KEYBYTES + sodium_constant :BYTES + sodium_constant :KEYBYTES sodium_function :onetimeauth_poly1305, :crypto_onetimeauth_poly1305, [:pointer, :pointer, :ulong_long, :pointer] sodium_function :onetimeauth_poly1305_verify, :crypto_onetimeauth_poly1305_verify, [:pointer, :pointer, :ulong_long, :pointer] private + def compute_authenticator(authenticator, message) self.class.onetimeauth_poly1305(authenticator, message, message.bytesize, key) end def verify_message(authenticator, message) self.class.onetimeauth_poly1305_verify(authenticator, message, message.bytesize, key) end - end end end