class RbNaCl::HMAC::SHA512

Computes an authenticator as HMAC-SHA-512

The authenticator can be used at a later time to verify the provenance of the message by recomputing the HMAC over the message and then comparing it to the provided authenticator. The class provides methods for generating signatures and also has a constant-time implementation for checking them.

This is a secret key authenticator, i.e. anyone who can verify signatures can also create them.

@see nacl.cr.yp.to/auth.html

Private Instance Methods

compute_authenticator(authenticator, message) click to toggle source
# File lib/rbnacl/hmac/sha512.rb, line 35
def compute_authenticator(authenticator, message)
  self.class.auth_hmacsha512(authenticator, message, message.bytesize, key)
end
verify_message(authenticator, message) click to toggle source
# File lib/rbnacl/hmac/sha512.rb, line 39
def verify_message(authenticator, message)
  self.class.auth_hmacsha512_verify(authenticator, message, message.bytesize, key)
end