freebsd_instance:
- image_family: freebsd-12-1
+ image_family: freebsd-14-1
freebsd_task:
env:
matrix:
- - OCAML_VERSION: 4.11.1
- - OCAML_VERSION: 4.12.0
+ - OCAML_VERSION: 4.13.1
+ - OCAML_VERSION: 4.14.2
pkg_install_script: pkg install -y ocaml-opam gmake bash
ocaml_script: opam init -a --comp=$OCAML_VERSION
- dependencies_script: eval `opam env` && opam install -y --deps-only .
+ dependencies_script: eval `opam env` && opam pin add -yn eqaf.dev . && opam pin add -yn eqaf-cstruct.dev . && opam install -y --deps-only eqaf eqaf-cstruct
build_script: eval `opam env` && dune build @install
test_script: eval `opam env` && opam install -y -t --deps-only . && dune build @runtest
strategy:
fail-fast: false
matrix:
- ocaml-version: ["4.10.0", "4.09.0", "4.08.1"]
+ ocaml-version: ["4.13.1", "4.14.2"]
operating-system: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.operating-system }}
uses: actions/checkout@v2
- name: Use OCaml ${{ matrix.ocaml-version }}
- uses: avsm/setup-ocaml@v2
+ uses: ocaml/setup-ocaml@v2
with:
- ocaml-version: ${{ matrix.ocaml-version }}
+ ocaml-compiler: ${{ matrix.ocaml-version }}
- name: Install nasm
uses: ilammy/setup-nasm@v1
+### v0.10 2024-06-14 Kyoto (Japon)
+
+- Implement functions provided by `eqaf` on bytes (@FantomeBeignet, #41)
+- Choose the right clock on MSVC systems (@dra27, #40)
+- Fix the lower bounds about base64 (@hannesm, #45)
+- Split `eqaf` and `eqaf-cstruct` (@dinosaure, @hannesm, #43)
+
### v0.9 2022-07-24 Paris (France)
- Add support of OCaml 5.00 (@kit-ty-kate, #37)
let system =
match system with
| "linux" | "elf" -> `Linux
- | "windows" | "mingw64" | "mingw" | "cygwin" -> `Windows
+ | "win32" | "win64" | "mingw64" | "mingw" | "cygwin" -> `Windows
| "freebsd" -> `FreeBSD
| "macosx" -> `MacOSX
+ | "beos" | "dragonfly" | "bsd" | "openbsd" | "netbsd" | "gnu"
+ | "solaris" | "unknown" ->
+ invalid_arg "Unsupported system: %s" system
| v ->
if String.sub system 0 5 = "linux"
then `Linux
(lang dune 2.0)
(name eqaf)
-(version v0.9)
+(version dev)
--- /dev/null
+opam-version: "2.0"
+maintainer: [ "Romain Calascibetta <romain.calascibetta@gmail.com>" ]
+authors: [ "Romain Calascibetta <romain.calascibetta@gmail.com>" ]
+homepage: "https://github.com/mirage/eqaf"
+bug-reports: "https://github.com/mirage/eqaf/issues"
+dev-repo: "git+https://github.com/mirage/eqaf.git"
+doc: "https://mirage.github.io/eqaf/"
+license: "MIT"
+synopsis: "Constant-time equal function on string"
+description: """
+This package provides an equal function on string in constant-time to avoid timing-attack with crypto stuff.
+"""
+
+build: [
+ [ "dune" "subst" ] {dev}
+ [ "dune" "build" "-p" name "-j" jobs ]
+]
+
+depends: [
+ "ocaml" {>= "4.07.0"}
+ "dune" {>= "2.0"}
+ "cstruct" {>= "1.1.0"}
+ "eqaf" {= version}
+]
-version: "0.9"
opam-version: "2.0"
maintainer: [ "Romain Calascibetta <romain.calascibetta@gmail.com>" ]
authors: [ "Romain Calascibetta <romain.calascibetta@gmail.com>" ]
depends: [
"ocaml" {>= "4.07.0"}
"dune" {>= "2.0"}
- "cstruct" {>= "1.1.0"}
- "base64" {with-test}
+ "base64" {with-test & >= "3.0.0"}
"alcotest" {with-test}
"crowbar" {with-test}
"fmt" {with-test & >= "0.8.7"}
"bechamel" {with-test}
-]
\ No newline at end of file
+]
(modules eqaf_bigstring)
(libraries eqaf))
+(library
+ (name eqaf_bytes)
+ (public_name eqaf.bytes)
+ (modules eqaf_bytes)
+ (libraries eqaf))
+
(library
(name eqaf_cstruct)
- (public_name eqaf.cstruct)
+ (public_name eqaf-cstruct)
(modules eqaf_cstruct)
(libraries cstruct eqaf.bigstring))
--- /dev/null
+let equal a b =
+ let a' = Bytes.unsafe_to_string a in
+ let b' = Bytes.unsafe_to_string b in
+ Eqaf.equal a' b'
+
+let compare_le_with_len ~len a b =
+ let a' = Bytes.unsafe_to_string a in
+ let b' = Bytes.unsafe_to_string b in
+ Eqaf.compare_le_with_len ~len a' b'
+
+let compare_le a b =
+ let a' = Bytes.unsafe_to_string a in
+ let b' = Bytes.unsafe_to_string b in
+ Eqaf.compare_le a' b'
+
+let compare_be_with_len ~len a b =
+ let a' = Bytes.unsafe_to_string a in
+ let b' = Bytes.unsafe_to_string b in
+ Eqaf.compare_be_with_len ~len a' b'
+
+let compare_be a b =
+ let a' = Bytes.unsafe_to_string a in
+ let b' = Bytes.unsafe_to_string b in
+ Eqaf.compare_be a' b'
+
+let find_uint8 ?off ~f b =
+ let str = Bytes.unsafe_to_string b in
+ Eqaf.find_uint8 ?off ~f str
+
+let exists_uint8 ?off ~f b =
+ let str = Bytes.unsafe_to_string b in
+ Eqaf.exists_uint8 ?off ~f str
--- /dev/null
+val equal : bytes -> bytes -> bool
+val compare_be : bytes -> bytes -> int
+val compare_be_with_len : len:int -> bytes -> bytes -> int
+val compare_le : bytes -> bytes -> int
+val compare_le_with_len : len:int -> bytes -> bytes -> int
+val find_uint8 : ?off:int -> f:(int -> bool) -> bytes -> int
+val exists_uint8 : ?off:int -> f:(int -> bool) -> bytes -> bool