Method: MoacEth::OpenSsl.recover_compact

Defined in:
lib/moac_eth/open_ssl.rb

.recover_compact(hash, signature) ⇒ Object



156
157
158
159
160
161
162
163
164
# File 'lib/moac_eth/open_ssl.rb', line 156

def recover_compact(hash, signature)
  return false if signature.bytesize != 65

  version = signature.unpack('C')[0]
  v_base = MoacEth.replayable_v?(version) ? MoacEth.replayable_chain_id : MoacEth.v_base
  return false if version < v_base

  recover_public_key_from_signature(hash, signature, (version - v_base), false)
end