New upstream version 0.10
authorStephane Glondu <steph@glondu.net>
Tue, 20 Aug 2024 06:53:23 +0000 (08:53 +0200)
committerStephane Glondu <steph@glondu.net>
Tue, 20 Aug 2024 06:53:23 +0000 (08:53 +0200)
.cirrus.yml
.github/workflows/test.yml
CHANGES.md
clock/select/select.ml
dune-project
eqaf-cstruct.opam [new file with mode: 0644]
eqaf.opam
lib/dune
lib/eqaf_bytes.ml [new file with mode: 0644]
lib/eqaf_bytes.mli [new file with mode: 0644]

index 2813ab662079d8589d8a28bb0f7ac294aae1f5b1..18b0a8da5f84693bfd6bd04b64d97f3d0cfc8d9e 100644 (file)
@@ -1,13 +1,13 @@
 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
index c2151fb20a341f02373e39ac30c63779a462debd..68033afeb6633277c331f7242720af22f1aa1031 100644 (file)
@@ -9,7 +9,7 @@ jobs:
     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 }}
@@ -19,9 +19,9 @@ jobs:
         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
index f0f9865ce87aa14894dc34abe42a7f214c95d6b1..aeab4427147f761b9a2553f2321c0159d8efd4f9 100644 (file)
@@ -1,3 +1,10 @@
+### 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)
index 78b45cfd0b8f1467da3dc4eaa031840bad52af1f..aea3237256418b48a88e7a62b5f833ede925ba05 100644 (file)
@@ -23,9 +23,12 @@ let () =
           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
index aa2d0b3377855ff3a2627c3bf04c977de7824f71..2a000c6b91dc2896c4602a30ad774e4d762bc7b5 100644 (file)
@@ -1,3 +1,3 @@
 (lang dune 2.0)
 (name eqaf)
-(version v0.9)
+(version dev)
diff --git a/eqaf-cstruct.opam b/eqaf-cstruct.opam
new file mode 100644 (file)
index 0000000..c67dc25
--- /dev/null
@@ -0,0 +1,24 @@
+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}
+]
index 2ea638b6d240ac84a763a2777f5b69b0a2b56236..0f32fef712ecdc2a38fea1f56f67bb13438507f5 100644 (file)
--- a/eqaf.opam
+++ b/eqaf.opam
@@ -1,4 +1,3 @@
-version: "0.9"
 opam-version: "2.0"
 maintainer:   [ "Romain Calascibetta <romain.calascibetta@gmail.com>" ]
 authors:      [ "Romain Calascibetta <romain.calascibetta@gmail.com>" ]
@@ -21,10 +20,9 @@ build: [
 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
+]
index 23e5572ee18ce97013ed55447bb812675525620b..1eb8de5531806f39230e2e566905a7ed646623c3 100644 (file)
--- a/lib/dune
+++ b/lib/dune
  (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))
diff --git a/lib/eqaf_bytes.ml b/lib/eqaf_bytes.ml
new file mode 100644 (file)
index 0000000..82bd4ce
--- /dev/null
@@ -0,0 +1,32 @@
+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
diff --git a/lib/eqaf_bytes.mli b/lib/eqaf_bytes.mli
new file mode 100644 (file)
index 0000000..9934136
--- /dev/null
@@ -0,0 +1,7 @@
+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