Sha256: 2003c55055b821d3f7f03957289e0bc007d09cfe5913ba42504b73b24513ae15

Contents?: true

Size: 346 Bytes

Versions: 15

Compression:

Stored size: 346 Bytes

Contents

# frozen_string_literal: true

module OpenSSL
  class HMAC
    # Securely compare with another HMAC instance in constant time.
    def ==(other)
      return false unless HMAC === other
      return false unless self.digest.bytesize == other.digest.bytesize

      OpenSSL.fixed_length_secure_compare(self.digest, other.digest)
    end
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
jruby-openssl-0.14.5-java lib/openssl/hmac.rb
jruby-openssl-0.14.4-java lib/openssl/hmac.rb
jruby-openssl-0.14.3-java lib/openssl/hmac.rb
jruby-openssl-0.14.2-java lib/openssl/hmac.rb
jruby-openssl-0.14.1-java lib/openssl/hmac.rb
openssl-2.2.3 lib/openssl/hmac.rb
openssl-custom-2.2.2 lib/openssl/hmac.rb
openssl-2.2.2 lib/openssl/hmac.rb
jruby-openssl-0.14.1.cr2-java lib/openssl/hmac.rb
jruby-openssl-0.14.0-java lib/openssl/hmac.rb
jruby-openssl-0.13.0-java lib/openssl/hmac.rb
jruby-openssl-0.12.2-java lib/openssl/hmac.rb
jruby-openssl-0.12.1-java lib/openssl/hmac.rb
openssl-2.2.1 lib/openssl/hmac.rb
openssl-2.2.0 lib/openssl/hmac.rb