Method: Ccrypto::Ruby::ED25519Engine.verify

Defined in:
lib/ccrypto/ruby/engines/ed25519_engine.rb

.verify(pubKey, val, sign) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/ccrypto/ruby/engines/ed25519_engine.rb', line 66

def self.verify(pubKey, val, sign)
  case pubKey
  when Ccrypto::ED25519PublicKey
    uPubKey = pubKey
  else
    raise KeypairEngineException, "Unsupported public key '#{pubKey.class}' for ED25519 operation"
  end

  begin
    uPubKey.verify(sign, val)
  rescue Ed25519::VerifyError => ex
    false
  end
end