diff --git a/.gitignore b/.gitignore index ffcec6b..1d79768 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ setup.data setup.log *.native *~ +.merlin +# This file is generated by the configure script +src/config/config_vars.ml diff --git a/Makefile b/Makefile deleted file mode 100644 index 3639f14..0000000 --- a/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: a3c674b4239234cbbe53afe090018954) - -SETUP = ocaml setup.ml - -build: setup.data - $(SETUP) -build $(BUILDFLAGS) - -doc: setup.data build - $(SETUP) -doc $(DOCFLAGS) - -test: setup.data build - $(SETUP) -test $(TESTFLAGS) - -all: - $(SETUP) -all $(ALLFLAGS) - -install: setup.data - $(SETUP) -install $(INSTALLFLAGS) - -uninstall: setup.data - $(SETUP) -uninstall $(UNINSTALLFLAGS) - -reinstall: setup.data - $(SETUP) -reinstall $(REINSTALLFLAGS) - -clean: - $(SETUP) -clean $(CLEANFLAGS) - -distclean: - $(SETUP) -distclean $(DISTCLEANFLAGS) - -setup.data: - $(SETUP) -configure $(CONFIGUREFLAGS) - -configure: - $(SETUP) -configure $(CONFIGUREFLAGS) - -.PHONY: build doc test all install uninstall reinstall clean distclean configure - -# OASIS_STOP diff --git a/README.md b/README.md index b05b631..ed83468 100644 --- a/README.md +++ b/README.md @@ -17,28 +17,28 @@ This library is distributed under the conditions of the GNU Library General Publ ## Requirements * OCaml 4.02 or more recent. -* The findlib/ocamlfind tool. -* The OASIS tool. +* The Dune build system, version 2.0 or more recent. * The Zarith library, version 1.4 or more recent. * The Zlib C library, version 1.1.3 or up is recommended. If it is not installed on your system (look for libz.a or libz.so), get it from http://www.gzip.org/, or indicate in the Makefile that you do not have it. If you are running Linux or BSD or MacOS, your distribution provides precompiled binaries for this library. * If the operating system does not provide the `/dev/random` device for random number generation, consider installing the [EGD](http://egd.sourceforge.net/) entropy gathering daemon. Without `/dev/random` nor EGD, this library cannot generate cryptographically-strong random data nor RSA keys. The remainder of the library still works, though. -## Installation +## Build, test and install -``` -./configure --enable-tests -make -make test -make install -``` +* To build, run `dune build`. -## Documentation +* To execute a test, run `dune exec test/.exe` where `` can be `test`, + `prngtest` or `speedtest`, supplying additional command line arguments if needed. + The main test file `test/test.ml` is also included into the `runtest` alias, so it + can be executed simply by `dune test`. + +* To install, run `dune install`. -See the extensive documentation comments in file src/cryptokit.mli. +## Documentation -Compilation options: `ocamlfind ocamlopt -package cryptokit`... +See the extensive documentation comments in file `src/cryptokit.mli`. -Linking options: `ocamlfind ocamlopt -linkpkg -package cryptokit`... +To build HTML documentation, run `dune build @doc`. The resulting index file is +located at `_build/default/_doc/_html/cryptokit/Cryptokit/index.html`. ## Warnings and disclaimers diff --git a/_oasis b/_oasis deleted file mode 100644 index 67b6d0b..0000000 --- a/_oasis +++ /dev/null @@ -1,148 +0,0 @@ -OASISFormat: 0.4 -Name: cryptokit -Version: 1.15 -Authors: Xavier Leroy -License: LGPL-2 with OCaml linking exception -BuildTools: ocamlbuild, ocamldoc -Plugins: META (0.4), DevFiles (0.4) - -Synopsis: Cryptographic primitives -Description: - This library provides a variety of cryptographic primitives that can be used - to implement cryptographic protocols in security-sensitive applications. The - primitives provided include: - . - - Symmetric-key ciphers: AES, Chacha20, Blowfish, DES, Triple-DES, ARCfour, - in ECB, CBC, CFB, OFB and counter modes. - - Public-key cryptography: RSA encryption, Diffie-Hellman key agreement. - - Hash functions and MACs: SHA-1, SHA-2, SHA-3, RIPEMD160, MD5, - and MACs based on AES and DES. - - Random number generation. - - Encodings and compression: base 64, hexadecimal, Zlib compression. - . - Additional ciphers and hashes can easily be used in conjunction with - the library. In particular, basic mechanisms such as chaining modes, - output buffering, and padding are provided by generic classes that can - easily be composed with user-provided ciphers. More generally, the library - promotes a "Lego"-like style of constructing and composing - transformations over character streams. - -Flag zlib - Description: Enable ZLib - Default$: !os_type(Win32) - -Flag hardwaresupport - Description: Enable hardware support for AES and GCM (needs GCC or Clang) - Default$: (architecture(amd64) || architecture(i386)) && !os_type(Win32) - -Library cryptokit - Path: src - Modules: CryptokitBignum, Cryptokit - CSources: aesni.c, - aesni.h, - arcfour.c, - arcfour.h, - stubs-arcfour.c, - blowfish.c, - blowfish.h, - stubs-blowfish.c, - d3des.c, - d3des.h, - stubs-des.c, - rijndael-alg-fst.c, - rijndael-alg-fst.h, - ripemd160.c, - ripemd160.h, - stubs-ripemd160.c, - sha1.c, - sha1.h, - stubs-sha1.c, - sha256.c, - sha256.h, - stubs-sha256.c, - sha512.c, - sha512.h, - stubs-sha512.c, - stubs-aes.c, - stubs-md5.c, - stubs-misc.c, - stubs-rng.c, - stubs-zlib.c, - keccak.h, - keccak.c, - stubs-sha3.c, - chacha20.h, - chacha20.c, - stubs-chacha20.c, - blake2.h, - blake2.c, - stubs-blake2.c - BuildDepends: unix, zarith - CCOpt: -DCAML_NAME_SPACE - if flag(zlib) - CCOpt+: -DHAVE_ZLIB - if system(win32) || system(win64) - CCLib: zlib.lib - else - CCLib: -lz - if system(win32) || system(win64) - CCLib+: advapi32.lib - else if system(mingw) || system(mingw64) - CCLib+: -ladvapi32 - if flag(hardwaresupport) - CCOpt+: -maes - -Executable test - Path: test - MainIs: test.ml - CompiledObject: native - BuildDepends: cryptokit - Build$: flag(tests) - Install: false - -Executable prngtest - Path: test - MainIs: prngtest.ml - CompiledObject: native - BuildDepends: cryptokit - Build$: flag(tests) - Install: false - -Test main - Command: $test - TestTools: test - -Flag bench - Description: Build and run benchmark - Default: false - -Executable speedtest - Path: test - MainIs: speedtest.ml - CompiledObject: native - BuildDepends: cryptokit - Install: false - Build$: flag(bench) - -Test bench - Command: $speedtest - Run$: flag(bench) - TestTools: speedtest - -Document "api-cryptokit" - Title: API reference for Cryptokit - Type: ocamlbuild (0.3) - InstallDir: $htmldir/cryptokit - BuildTools+: ocamldoc - XOCamlBuildPath: src/ - XOCamlbuildLibraries: cryptokit - -SourceRepository head - Type: git - Location: https://github.com/xavierleroy/cryptokit - Browser: https://github.com/xavierleroy/cryptokit - -SourceRepository this - Type: git - Location: https://github.com/xavierleroy/cryptokit/releases/tag/release113 - Browser: https://github.com/xavierleroy/cryptokit/releases/tag/release113 diff --git a/_tags b/_tags deleted file mode 100644 index 2375723..0000000 --- a/_tags +++ /dev/null @@ -1,128 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: 552f3e8992f1455e10be051255154125) -# Ignore VCS directories, you can use the same kind of rule outside -# OASIS_START/STOP if you want to exclude directories that contains -# useless stuff for the build process -true: annot, bin_annot -<**/.svn>: -traverse -<**/.svn>: not_hygienic -".bzr": -traverse -".bzr": not_hygienic -".hg": -traverse -".hg": not_hygienic -".git": -traverse -".git": not_hygienic -"_darcs": -traverse -"_darcs": not_hygienic -# Library cryptokit -"src/cryptokit.cmxs": use_cryptokit -: oasis_library_cryptokit_ccopt -"src/aesni.c": oasis_library_cryptokit_ccopt -"src/arcfour.c": oasis_library_cryptokit_ccopt -"src/stubs-arcfour.c": oasis_library_cryptokit_ccopt -"src/blowfish.c": oasis_library_cryptokit_ccopt -"src/stubs-blowfish.c": oasis_library_cryptokit_ccopt -"src/d3des.c": oasis_library_cryptokit_ccopt -"src/stubs-des.c": oasis_library_cryptokit_ccopt -"src/rijndael-alg-fst.c": oasis_library_cryptokit_ccopt -"src/ripemd160.c": oasis_library_cryptokit_ccopt -"src/stubs-ripemd160.c": oasis_library_cryptokit_ccopt -"src/sha1.c": oasis_library_cryptokit_ccopt -"src/stubs-sha1.c": oasis_library_cryptokit_ccopt -"src/sha256.c": oasis_library_cryptokit_ccopt -"src/stubs-sha256.c": oasis_library_cryptokit_ccopt -"src/sha512.c": oasis_library_cryptokit_ccopt -"src/stubs-sha512.c": oasis_library_cryptokit_ccopt -"src/stubs-aes.c": oasis_library_cryptokit_ccopt -"src/stubs-md5.c": oasis_library_cryptokit_ccopt -"src/stubs-misc.c": oasis_library_cryptokit_ccopt -"src/stubs-rng.c": oasis_library_cryptokit_ccopt -"src/stubs-zlib.c": oasis_library_cryptokit_ccopt -"src/keccak.c": oasis_library_cryptokit_ccopt -"src/stubs-sha3.c": oasis_library_cryptokit_ccopt -"src/chacha20.c": oasis_library_cryptokit_ccopt -"src/stubs-chacha20.c": oasis_library_cryptokit_ccopt -"src/blake2.c": oasis_library_cryptokit_ccopt -"src/stubs-blake2.c": oasis_library_cryptokit_ccopt -: oasis_library_cryptokit_cclib -"src/libcryptokit_stubs.lib": oasis_library_cryptokit_cclib -"src/dllcryptokit_stubs.dll": oasis_library_cryptokit_cclib -"src/libcryptokit_stubs.a": oasis_library_cryptokit_cclib -"src/dllcryptokit_stubs.so": oasis_library_cryptokit_cclib -: use_libcryptokit_stubs -: pkg_unix -: pkg_zarith -"src/aesni.c": pkg_unix -"src/aesni.c": pkg_zarith -"src/arcfour.c": pkg_unix -"src/arcfour.c": pkg_zarith -"src/stubs-arcfour.c": pkg_unix -"src/stubs-arcfour.c": pkg_zarith -"src/blowfish.c": pkg_unix -"src/blowfish.c": pkg_zarith -"src/stubs-blowfish.c": pkg_unix -"src/stubs-blowfish.c": pkg_zarith -"src/d3des.c": pkg_unix -"src/d3des.c": pkg_zarith -"src/stubs-des.c": pkg_unix -"src/stubs-des.c": pkg_zarith -"src/rijndael-alg-fst.c": pkg_unix -"src/rijndael-alg-fst.c": pkg_zarith -"src/ripemd160.c": pkg_unix -"src/ripemd160.c": pkg_zarith -"src/stubs-ripemd160.c": pkg_unix -"src/stubs-ripemd160.c": pkg_zarith -"src/sha1.c": pkg_unix -"src/sha1.c": pkg_zarith -"src/stubs-sha1.c": pkg_unix -"src/stubs-sha1.c": pkg_zarith -"src/sha256.c": pkg_unix -"src/sha256.c": pkg_zarith -"src/stubs-sha256.c": pkg_unix -"src/stubs-sha256.c": pkg_zarith -"src/sha512.c": pkg_unix -"src/sha512.c": pkg_zarith -"src/stubs-sha512.c": pkg_unix -"src/stubs-sha512.c": pkg_zarith -"src/stubs-aes.c": pkg_unix -"src/stubs-aes.c": pkg_zarith -"src/stubs-md5.c": pkg_unix -"src/stubs-md5.c": pkg_zarith -"src/stubs-misc.c": pkg_unix -"src/stubs-misc.c": pkg_zarith -"src/stubs-rng.c": pkg_unix -"src/stubs-rng.c": pkg_zarith -"src/stubs-zlib.c": pkg_unix -"src/stubs-zlib.c": pkg_zarith -"src/keccak.c": pkg_unix -"src/keccak.c": pkg_zarith -"src/stubs-sha3.c": pkg_unix -"src/stubs-sha3.c": pkg_zarith -"src/chacha20.c": pkg_unix -"src/chacha20.c": pkg_zarith -"src/stubs-chacha20.c": pkg_unix -"src/stubs-chacha20.c": pkg_zarith -"src/blake2.c": pkg_unix -"src/blake2.c": pkg_zarith -"src/stubs-blake2.c": pkg_unix -"src/stubs-blake2.c": pkg_zarith -# Executable test -"test/test.native": pkg_unix -"test/test.native": pkg_zarith -"test/test.native": use_cryptokit -# Executable prngtest -"test/prngtest.native": pkg_unix -"test/prngtest.native": pkg_zarith -"test/prngtest.native": use_cryptokit -# Executable speedtest -"test/speedtest.native": pkg_unix -"test/speedtest.native": pkg_zarith -"test/speedtest.native": use_cryptokit -: pkg_unix -: pkg_zarith -: use_cryptokit -# OASIS_STOP -"build": not_hygienic -"build": -traverse -"src/cryptokit.cmxs": use_libcryptokit_stubs -<*/*.cm{o,x}>: safe_string diff --git a/configure b/configure index 6acfaeb..0037908 100755 --- a/configure +++ b/configure @@ -1,27 +1,48 @@ -#!/bin/sh +#!/usr/bin/env ocaml +(* -*- tuareg -*- *) -# OASIS_START -# DO NOT EDIT (digest: dc86c2ad450f91ca10c931b6045d0499) -set -e +type 'a value = + | This of 'a + | Auto -FST=true -for i in "$@"; do - if $FST; then - set -- - FST=false - fi +let string_of_value to_string = function + | This a -> "This (" ^ to_string a ^ ")" + | Auto -> "Auto" - case $i in - --*=*) - ARG=${i%%=*} - VAL=${i##*=} - set -- "$@" "$ARG" "$VAL" - ;; - *) - set -- "$@" "$i" - ;; - esac -done +let () = + let declare_flag arg description = + let reference = ref Auto in + let args = + [ "--enable-" ^ arg, Arg.Unit (fun () -> reference := This true), + " Enable " ^ description + ; "--disable-" ^ arg, Arg.Unit (fun () -> reference := This false), + " Disable " ^ description + ] + in args, reference + in + let args_zlib, ref_zlib = declare_flag "zlib" "ZLib" in + let args_hardware_support, ref_hardware_support = + declare_flag "hardwaresupport" + "hardware support for AES and GCM (needs GCC or Clang)" in + Arg.parse + (Arg.align (args_zlib @ args_hardware_support)) + (fun s -> raise (Arg.Bad (Printf.sprintf "don't know what to do with %S" s))) + "Usage: ./configure [OPTIONS]"; + let oc = open_out_bin "src/config/config_vars.ml" in + Printf.fprintf oc {| +type 'a value = + | This of 'a + | Auto -ocaml setup.ml -configure "$@" -# OASIS_STOP +let enable_zlib = %s +let enable_hardware_support = %s +|} + (string_of_value string_of_bool !ref_zlib) + (string_of_value string_of_bool !ref_hardware_support); + close_out oc; + (* Below is a temporary workaround to make sure the configuration happens + every time this script is run. *) + (try + Sys.remove "_build/default/src/flags.sexp"; + with _ -> ()); + exit (Sys.command "dune build @configure --release") diff --git a/cryptokit.opam b/cryptokit.opam new file mode 100644 index 0000000..132bd7d --- /dev/null +++ b/cryptokit.opam @@ -0,0 +1,35 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "A library of cryptographic primitives" +description: """ +Cryptokit includes block ciphers (AES, DES, 3DES), stream ciphers +(ARCfour), public-key crypto (RSA, DH), hashes (SHA-1, SHA-256, +SHA-3), MACs, compression, random number generation -- all presented +with a compositional, extensible interface.""" +maintainer: ["Xavier Leroy "] +authors: ["Xavier Leroy"] +homepage: "https://github.com/xavierleroy/cryptokit" +bug-reports: "https://github.com/xavierleroy/cryptokit/issues" +depends: [ + "ocaml" {>= "4.02.0"} + "dune" {>= "2.0"} + "dune-configurator" + "zarith" {>= "1.4"} + "conf-zlib" + "conf-gmp-powm-sec" +] +build: [ + ["dune" "subst"] {pinned} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/xavierleroy/cryptokit.git" diff --git a/dune-project b/dune-project new file mode 100644 index 0000000..9796530 --- /dev/null +++ b/dune-project @@ -0,0 +1,24 @@ +(lang dune 2.0) +(generate_opam_files true) + +(name cryptokit) +(source (github xavierleroy/cryptokit)) +(authors "Xavier Leroy") +(maintainers "Xavier Leroy ") + +(package + (name cryptokit) + (synopsis "A library of cryptographic primitives") + + (description "Cryptokit includes block ciphers (AES, DES, 3DES), stream ciphers +(ARCfour), public-key crypto (RSA, DH), hashes (SHA-1, SHA-256, +SHA-3), MACs, compression, random number generation -- all presented +with a compositional, extensible interface.") + + (depends + (ocaml (>= 4.02.0)) + (dune (>= 2.0)) + dune-configurator + (zarith (>= 1.4)) + conf-zlib + conf-gmp-powm-sec)) diff --git a/setup.ml b/setup.ml deleted file mode 100644 index a07ec9f..0000000 --- a/setup.ml +++ /dev/null @@ -1,39 +0,0 @@ -(* setup.ml generated for the first time by OASIS v0.4.6 *) - -(* OASIS_START *) -(* DO NOT EDIT (digest: a426e2d026defb34183b787d31fbdcff) *) -(******************************************************************************) -(* OASIS: architecture for building OCaml libraries and applications *) -(* *) -(* Copyright (C) 2011-2016, Sylvain Le Gall *) -(* Copyright (C) 2008-2011, OCamlCore SARL *) -(* *) -(* This library is free software; you can redistribute it and/or modify it *) -(* under the terms of the GNU Lesser General Public License as published by *) -(* the Free Software Foundation; either version 2.1 of the License, or (at *) -(* your option) any later version, with the OCaml static compilation *) -(* exception. *) -(* *) -(* This library is distributed in the hope that it will be useful, but *) -(* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *) -(* or FITNESS FOR A PARTICULAR PURPOSE. See the file COPYING for more *) -(* details. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public License *) -(* along with this library; if not, write to the Free Software Foundation, *) -(* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *) -(******************************************************************************) - -let () = - try - Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH") - with Not_found -> () -;; -#use "topfind";; -#require "oasis.dynrun";; -open OASISDynRun;; - -let setup_t = BaseCompat.Compat_0_4.adapt_setup_t setup_t -open BaseCompat.Compat_0_4 -(* OASIS_STOP *) -let () = setup ();; diff --git a/src/META b/src/META deleted file mode 100644 index 98a8e7d..0000000 --- a/src/META +++ /dev/null @@ -1,12 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: 0b7c5c15af8df30a424bef17dc87d1b1) -version = "1.15" -description = "Cryptographic primitives" -requires = "unix zarith" -archive(byte) = "cryptokit.cma" -archive(byte, plugin) = "cryptokit.cma" -archive(native) = "cryptokit.cmxa" -archive(native, plugin) = "cryptokit.cmxs" -exists_if = "cryptokit.cma" -# OASIS_STOP - diff --git a/src/api-cryptokit.odocl b/src/api-cryptokit.odocl deleted file mode 100644 index c8577fb..0000000 --- a/src/api-cryptokit.odocl +++ /dev/null @@ -1,5 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: f65b9dc92e3f638af8533b26ac90c400) -CryptokitBignum -Cryptokit -# OASIS_STOP diff --git a/src/config/config_vars.ml.default b/src/config/config_vars.ml.default new file mode 100644 index 0000000..1b56c41 --- /dev/null +++ b/src/config/config_vars.ml.default @@ -0,0 +1,7 @@ +type 'a value = + | This of 'a + | Auto + +let enable_zlib = Auto + +let enable_hardware_support = Auto diff --git a/src/config/dune b/src/config/dune new file mode 100644 index 0000000..ece93d5 --- /dev/null +++ b/src/config/dune @@ -0,0 +1,7 @@ +(executable + (name flags) + (libraries dune-configurator)) + +(rule + (mode fallback) + (action (copy config_vars.ml.default config_vars.ml))) diff --git a/src/config/flags.ml b/src/config/flags.ml new file mode 100644 index 0000000..f8f2157 --- /dev/null +++ b/src/config/flags.ml @@ -0,0 +1,45 @@ +(* Compute compilation and linking flags *) + +open Config_vars + +module Configurator = Configurator.V1 + +(* Compile and link a dummy C program with the given flags. *) +let test ~cfg ~c_flags ~link_flags = + let test_program = "int main() { return 0; }" in + Configurator.c_test cfg test_program ~c_flags ~link_flags + +let () = Configurator.main ~name:"cryptokit" (fun cfg -> + let os_type = Configurator.ocaml_config_var_exn cfg "os_type" in + let system = Configurator.ocaml_config_var_exn cfg "system" in + let architecture = Configurator.ocaml_config_var_exn cfg "architecture" in + let zlib = match enable_zlib with + | This bool -> bool + | Auto -> os_type <> "Win32" + in + let hardware_support = match enable_hardware_support with + | This bool -> bool + | Auto -> (architecture = "amd64" || architecture = "i386") + && test ~cfg ~c_flags:[ "-maes" ] ~link_flags:[] + in + let append_if c y x = if c then x @ [ y ] else x in + let flags = + [] + |> append_if zlib "-DHAVE_ZLIB" + |> append_if hardware_support "-maes" + in + let library_flags = + [] + |> append_if (zlib && (system = "win32" || system = "win64")) "zlib.lib" + |> append_if (zlib && system <> "win32" && system <> "win64") "-lz" + |> append_if (system = "win32" || system = "win64") "advapi32.lib" + |> append_if (system = "mingw" || system = "mingw64") "-ladvapi32" + in + Configurator.Flags.write_sexp "flags.sexp" flags; + Configurator.Flags.write_sexp "library_flags.sexp" library_flags; + let describe_bool = function + | true -> "enabled" + | false -> "disabled" + in + Printf.printf "ZLib: ............................... %s\n" (describe_bool zlib); + Printf.printf "Hardware support for AES and GCM: ... %s\n" (describe_bool hardware_support)) diff --git a/src/cryptokit.mldylib b/src/cryptokit.mldylib deleted file mode 100644 index c8577fb..0000000 --- a/src/cryptokit.mldylib +++ /dev/null @@ -1,5 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: f65b9dc92e3f638af8533b26ac90c400) -CryptokitBignum -Cryptokit -# OASIS_STOP diff --git a/src/cryptokit.mllib b/src/cryptokit.mllib deleted file mode 100644 index c8577fb..0000000 --- a/src/cryptokit.mllib +++ /dev/null @@ -1,5 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: f65b9dc92e3f638af8533b26ac90c400) -CryptokitBignum -Cryptokit -# OASIS_STOP diff --git a/src/dune b/src/dune new file mode 100644 index 0000000..a6642bc --- /dev/null +++ b/src/dune @@ -0,0 +1,41 @@ +(library (name cryptokit) (public_name cryptokit) + (libraries unix zarith) + (modules CryptokitBignum Cryptokit) + (foreign_stubs + (language c) + (flags -DCAML_NAME_SPACE (:include flags.sexp)) + (names aesni + arcfour + stubs-arcfour + blowfish + stubs-blowfish + d3des + stubs-des + rijndael-alg-fst + ripemd160 + stubs-ripemd160 + sha1 + stubs-sha1 + sha256 + stubs-sha256 + sha512 + stubs-sha512 + stubs-aes + stubs-md5 + stubs-misc + stubs-rng + stubs-zlib + keccak + stubs-sha3 + chacha20 + stubs-chacha20 + blake2 + stubs-blake2)) + (c_library_flags (:include library_flags.sexp)) + (flags :standard -safe-string -w -7 -w -27 -w -37)) + +; compute flags +(rule + (alias configure) + (targets flags.sexp library_flags.sexp) + (action (run config/flags.exe))) diff --git a/src/libcryptokit_stubs.clib b/src/libcryptokit_stubs.clib deleted file mode 100644 index 610e2e2..0000000 --- a/src/libcryptokit_stubs.clib +++ /dev/null @@ -1,30 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: 460f3639307284eb4bb0467641bc366c) -aesni.o -arcfour.o -stubs-arcfour.o -blowfish.o -stubs-blowfish.o -d3des.o -stubs-des.o -rijndael-alg-fst.o -ripemd160.o -stubs-ripemd160.o -sha1.o -stubs-sha1.o -sha256.o -stubs-sha256.o -sha512.o -stubs-sha512.o -stubs-aes.o -stubs-md5.o -stubs-misc.o -stubs-rng.o -stubs-zlib.o -keccak.o -stubs-sha3.o -chacha20.o -stubs-chacha20.o -blake2.o -stubs-blake2.o -# OASIS_STOP diff --git a/test/dune b/test/dune new file mode 100644 index 0000000..3e89187 --- /dev/null +++ b/test/dune @@ -0,0 +1,16 @@ +(test + (name test) + (modules test) + (libraries cryptokit) + (flags :standard -w -35)) + +(executable + (name prngtest) + (modules prngtest) + (libraries cryptokit)) + +(executable + (name speedtest) + (modules speedtest) + (libraries cryptokit) + (flags :standard -w -35))