<commit_before># originally lifted from https://github.com/lian/bitcoin-ruby
# thanks to everyone there for figuring this out

module Eth
  class OpenSsl
    extend FFI::Library

    if FFI::Platform.windows?
      ffi_lib 'libeay32', 'ssleay32'
    else
      ffi_lib 'ssl'
    end

    NID_secp256k1 = 714
    POINT_CONVERSION_COMPRESSED = 2
    POINT_CONVERSION_UNCOMPRESSED = 4

    attach_function :SSL_library_init, [], :int
    attach_function :ERR_load_crypto_strings, [], :void
    attach_function :SSL_load_error_strings, [], :void
    attach_function :RAND_poll, [], :int

    attach_function :BN_CTX_free, [:pointer], :int
    attach_function :BN_CTX_new, [], :pointer
    attach_function :BN_add, [:pointer, :pointer, :pointer], :int
    attach_function :BN_bin2bn, [:pointer, :int, :pointer], :pointer
    attach_function :BN_bn2bin, [:pointer, :pointer], :int
    attach_function :BN_cmp, [:pointer, :pointer], :int
    attach_function :BN_dup, [:pointer], :pointer
    attach_function :BN_free, [:pointer], :int
    attach_function :BN_mod_inverse, [:pointer, :pointer, :pointer, :pointer], :pointer
    attach_function :BN_mod_mul, [:pointer, :pointer, :pointer, :pointer, :pointer], :int
    attach_function :BN_mod_sub, [:pointer, :pointer, :pointer, :pointer, :pointer], :int
    attach_function :BN_mul_word, [:pointer, :int], :int
    attach_function :BN_new, [], :pointer
    attach_function :BN_num_bits, [:pointer], :int
    attach_function :BN_rshift, [:pointer, :pointer, :int], :int
    attach_function :BN_set_word, [:pointer, :int], :int
    attach_function :ECDSA_SIG_free, [:pointer], :void<commit_msg>prefer openssl 1.0 over default, which may be 1.1<commit_after># originally lifted from https://github.com/lian/bitcoin-ruby
# thanks to everyone there for figuring this out

module Eth
  class OpenSsl
    extend FFI::Library

    if FFI::Platform.windows?
      ffi_lib 'libeay32', 'ssleay32'
    else
      ffi_lib ['libssl.so.1.0.0', 'ssl']
    end

    NID_secp256k1 = 714
    POINT_CONVERSION_COMPRESSED = 2
    POINT_CONVERSION_UNCOMPRESSED = 4

    attach_function :SSL_library_init, [], :int
    attach_function :ERR_load_crypto_strings, [], :void
    attach_function :SSL_load_error_strings, [], :void
    attach_function :RAND_poll, [], :int

    attach_function :BN_CTX_free, [:pointer], :int
    attach_function :BN_CTX_new, [], :pointer
    attach_function :BN_add, [:pointer, :pointer, :pointer], :int
    attach_function :BN_bin2bn, [:pointer, :int, :pointer], :pointer
    attach_function :BN_bn2bin, [:pointer, :pointer], :int
    attach_function :BN_cmp, [:pointer, :pointer], :int
    attach_function :BN_dup, [:pointer], :pointer
    attach_function :BN_free, [:pointer], :int
    attach_function :BN_mod_inverse, [:pointer, :pointer, :pointer, :pointer], :pointer
    attach_function :BN_mod_mul, [:pointer, :pointer, :pointer, :pointer, :pointer], :int
    attach_function :BN_mod_sub, [:pointer, :pointer, :pointer, :pointer, :pointer], :int
    attach_function :BN_mul_word, [:pointer, :int], :int
    attach_function :BN_new, [], :pointer
    attach_function :BN_num_bits, [:pointer], :int
    attach_function :BN_rshift, [:pointer, :pointer, :int], :int
    attach_function :BN_set_word, [:pointer, :int], :int
    attach_function :ECDSA_SIG_free, [:pointer], :void
{'fraction_non_alphanumeric': 0.13052631578947368, 'fraction_numerical': 0.011127819548872181, 'mean_word_length': 4.774305555555555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1957850', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1125, 'n_words': 274}