ig-crypto-utils/lib/ig-crypto-utils.rb
# for a 256-bit ECDSA curve, the uncompressed pubkey is 512 bits (256 bits of x, 256 bits of y, no sign bit).
# The compressed pubkey is 257 bits (256 bits of x, one bit of the sign of y).
for a 256-bit ECDSA curve, the uncompressed pubkey is 512 bits (256 bits of x, 256 bits of y, no sign bit).
The compressed pubkey is 257 bits (256 bits of x, one bit of the sign of y).
for a 256 - bit ECDSA curve the uncompressed pubkey is 512 bits ( 256 bits of x 256 bits of y no sign bit ) . The compressed pubkey is 257 bits ( 256 bits of x one bit of the sign of y ) .
def validate_signature(encoded_digest, encoded_signature, encoded_public_key)
      group_name = 'secp256k1'
      decoded_signature = Base64.decode64 encoded_signature
      decoded_digest = Base64.decode64 encoded_digest
      decoded_public_key = Base64.decode64 encoded_public_key
      curve = OpenSSL::PKey::EC.new(group_name)
      key_bn = OpenSSL::BN.new(decoded_public_key, 2)
      group = OpenSSL::PKey::EC::Group.new(group_name)
      curve.public_key = OpenSSL::PKey::EC::Point.new(group, key_bn)
      curve.dsa_verify_asn1(decoded_digest, decoded_signature)
    end
def validate_signature ( encoded_digest , encoded_signature , encoded_public_key ) group_name = 'secp256k1' decoded_signature = Base64 . decode64 encoded_signature decoded_digest = Base64 . decode64 encoded_digest decoded_public_key = Base64 . decode64 encoded_public_key curve = OpenSSL :: PKey :: EC . new ( group_name ) key_bn = OpenSSL :: BN . new ( decoded_public_key , 2 ) group = OpenSSL :: PKey :: EC :: Group . new ( group_name ) curve . public_key = OpenSSL :: PKey :: EC :: Point . new ( group , key_bn ) curve . dsa_verify_asn1 ( decoded_digest , decoded_signature ) end
for a 256-bit ECDSA curve, the uncompressed pubkey is 512 bits (256 bits of x, 256 bits of y, no sign bit).
for a 256 - bit ECDSA curve the uncompressed pubkey is 512 bits ( 256 bits of x 256 bits of y no sign bit ) .
encoded_digest
<not_specific>
encoded_signature
<not_specific>
encoded_public_key
<not_specific>