examples/ethereum_key_recovery/key_recovery.rb
# Produce a signature with legacy v values.
#
# @param private_key [Secp256k1::PrivateKey] key to use for signing.
# @return [String] binary signature data including legacy recovery id v at end.
Produce a signature with legacy v values.
Produce a signature with legacy v values .
def sign_legacy(private_key)
    ctx = Secp256k1::Context.new
    signature, recovery_id = ctx.sign_recoverable(private_key, hash).compact
    result = signature.bytes
    result = result.append(27 + recovery_id)
    result.pack('c*')
  end
def sign_legacy ( private_key ) ctx = Secp256k1 :: Context . new signature , recovery_id = ctx . sign_recoverable ( private_key , hash ) . compact result = signature . bytes result = result . append ( 27 + recovery_id ) result . pack ( 'c*' ) end
Produce a signature with legacy v values.
Produce a signature with legacy v values .
binary signature data including legacy recovery id v at end.
binary signature data including legacy recovery id v at end .
String
private_key
key to use for signing.
key to use for signing .