1 2 3 4 5 6 7 8 9 10 11
require "ffi" module Crypto def self.setup FFI::Library.attach_function :crypto_encrypt, [:pointer, :int], :int end def self.encrypt(buffer, size) crypto_encrypt(buffer, size) end end