mirage / hacl

Archived. Curve25519 support has been integrated into mirage-crypto-ec (via fiat-crypto). Hacl bindings are available from the hacl-star opam package. OCaml bindings for HACL* elliptic curves
https://github.com/mirage/mirage-crypto
Other
20 stars 5 forks source link

Compilation error on 32-bit platforms #34

Closed talex5 closed 4 years ago

talex5 commented 4 years ago

Happens on arm32 and i386. e.g.

docker run --rm -it ocurrent/opam-staging:debian-10-ocaml-4.10-i386 opam install hacl_x25519

gives:

#=== ERROR while compiling hacl_x25519.0.1.1 ==================================#
# context     2.0.7 | linux/x86_32 | ocaml-base-compiler.4.10.0 | file:///home/opam/opam-repository
# path        ~/.opam/4.10/.opam-switch/build/hacl_x25519.0.1.1
# command     ~/.opam/4.10/bin/dune build -p hacl_x25519 -j 71
# exit-code   1
# env-file    ~/.opam/log/hacl_x25519-10-e4f8df.env
# output-file ~/.opam/log/hacl_x25519-10-e4f8df.out
### output ###
#       ocamlc src/hacl_x25519_stubs.o (exit 2)
# (cd _build/default/src && /home/opam/.opam/4.10/bin/ocamlc.opt -g -I /home/opam/.opam/4.10/lib/bigarray-compat -I /home/opam/.opam/4.10/lib/cstruct -I /home/opam/.opam/4.10/lib/eqaf -ccopt -O2 -ccopt -fno-strict-aliasing -ccopt -fwrapv -ccopt -fPIC -ccopt -g -o hacl_x25519_stubs.o hacl_x25519_stubs.c)
# In file included from Hacl_Curve25519.h:24,
#                  from hacl_x25519_stubs.c:4:
# kremlib.h:443:18: error: '__int128' is not supported on this target
#  typedef unsigned __int128 FStar_UInt128_t, FStar_UInt128_t_, uint128_t;
#                   ^~~~~~~~
# kremlib.h: In function 'print128':
# kremlib.h:447:33: warning: right shift count >= width of type [-Wshift-count-overflow]
#                     (uint64_t)(n >> 64), (uint64_t)n);
#                                  ^~
dinosaure commented 4 years ago

Notifed on the mailing list and fixed upstream. We should copy the result of the extraction into this repository - however, an automatic process should be better.

dinosaure commented 4 years ago

Fixed according to CI and #36