2015-10-19 11:23:46 +00:00
|
|
|
class Libuecc < Formula
|
|
|
|
desc "Very small Elliptic Curve Cryptography library"
|
|
|
|
homepage "http://git.universe-factory.net/libuecc/"
|
2015-10-26 18:49:49 +00:00
|
|
|
url "http://git.universe-factory.net/libuecc/snapshot/libuecc-6.tar"
|
|
|
|
sha256 "fe61715b7cd8458616840f71ab8c0c7e5f49480a9cfb2c1965fbb9d713f071b6"
|
2015-10-19 11:23:46 +00:00
|
|
|
|
|
|
|
head "git://git.universe-factory.net/libuecc"
|
|
|
|
|
2015-10-19 13:00:46 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-10-26 19:39:02 +00:00
|
|
|
sha256 "f2f8b73e024086946b28531462bf6fdb7d53d555c49ff2b19d046c6ae4397abe" => :el_capitan
|
|
|
|
sha256 "ae65696aaa43faefb426eccdd60bed6bcd9e267f6bb4cde7eccb8f5846126601" => :yosemite
|
|
|
|
sha256 "5013357b9cc252f75220bff31182e618eda02468bb7ccabb6d9c9de503ef2e1f" => :mavericks
|
2015-10-19 13:00:46 +00:00
|
|
|
end
|
|
|
|
|
2015-10-19 11:23:46 +00:00
|
|
|
depends_on "cmake" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "cmake", ".", *std_cmake_args
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <libuecc/ecc.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
ecc_int256_t secret;
|
|
|
|
ecc_25519_gf_sanitize_secret(&secret, &secret);
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cc, "-I#{include}/libuecc-#{version}", "-L#{lib}", "-o", "test", "test.c", "-luecc"
|
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|