Skip to content

Conversation

@syaiful6
Copy link

Passe is library for hashing and verifying passwords using bcrypt and argon2 algorithms

CHANGES:

0.1.0

Initial release of passe, includes:

  • Bcrypt hash and verify functions
  • Argon2 hash and verify functions

"ocaml" {>= "4.14"}
"dune" {>= "3.19"}
"mirage-crypto"
"mirage-crypto-rng"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"mirage-crypto-rng"
"mirage-crypto-rng" {>= "1.2.0"}

to address this:
https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/7cf44dd59f3d701719ec977f781508489f6d4236/variant/compilers,5.4,passe.0.1.0,lower-bounds

=== downgrade 9 packages
  - downgrade csexp             1.5.2 to 1.3.1   [uses dune]
  - downgrade dune              3.20.2 to 3.19.0 [required by passe]
  - downgrade dune-configurator 3.20.2 to 2.9.3  [uses dune]
  - downgrade logs              0.10.0 to 0.7.0  [required by mirage-crypto-rng]
  - downgrade mirage-crypto     2.0.2 to 0.8.0   [required by passe]
  - downgrade mirage-crypto-rng 2.0.2 to 0.8.0   [required by passe]
  - downgrade ocamlbuild        0.16.1 to 0.14.3 [required by logs, mtime]
  - downgrade ocamlfind         1.9.8 to 1.9.6   [required by logs, mtime]
  - downgrade topkg             1.1.1 to 1.0.8   [required by logs, mtime]
[...]
#=== ERROR while compiling passe.0.1.0 ========================================#
# context              2.5.0 | linux/x86_64 | ocaml-base-compiler.5.4.0 | pinned(https://github.com/syaiful6/passe/releases/download/0.1.0/passe-0.1.0.tbz)
# path                 ~/.opam/5.4/.opam-switch/build/passe.0.1.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p passe -j 71 @install
# exit-code            1
# env-file             ~/.opam/log/passe-7-b71858.env
# output-file          ~/.opam/log/passe-7-b71858.out
### output ###
# (cd _build/default && /home/opam/.opam/5.4/bin/ocamlc.opt -w -40 -g -bin-annot -bin-annot-occurrences -I src/.passe.objs/byte -I /home/opam/.opam/5.4/lib/cstruct -I /home/opam/.opam/5.4/lib/logs -I /home/opam/.opam/5.4/lib/mirage-crypto -I /home/opam/.opam/5.4/lib/mirage-crypto-rng -I /home/opam/.opam/5.4/lib/mirage-crypto-rng/unix -I /home/opam/.opam/5.4/lib/ocaml/unix -no-alias-deps -open Passe__ -o src/.passe.objs/byte/passe__Crypto.cmo -c -impl src/crypto.ml)
# File "src/crypto.ml", line 1, characters 9-46:
# 1 | let () = Mirage_crypto_rng_unix.use_getentropy ()
#              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Error: Unbound value Mirage_crypto_rng_unix.use_getentropy

as that binding was added in 1.2.0:
https://github.com/mirage/mirage-crypto/blob/v1.2.0/rng/unix/mirage_crypto_rng_unix.mli

Copy link
Member

@jmid jmid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

There's a missing lower bound - see suggestion.

There are also 32-bit errors on x86_32 and arm32, e.g.,
https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/7cf44dd59f3d701719ec977f781508489f6d4236/variant/extras,arm32-ocaml-4.14,passe.0.1.0

#=== ERROR while compiling passe.0.1.0 ========================================#
# context              2.5.0 | linux/arm32 | ocaml-base-compiler.4.14.2 | pinned(https://github.com/syaiful6/passe/releases/download/0.1.0/passe-0.1.0.tbz)
# path                 ~/.opam/4.14/.opam-switch/build/passe.0.1.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p passe -j 79 @install
# exit-code            1
# env-file             ~/.opam/log/passe-7-e5d1e2.env
# output-file          ~/.opam/log/passe-7-e5d1e2.out
### output ###
# (cd _build/default && /home/opam/.opam/4.14/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.passe.objs/byte -I /home/opam/.opam/4.14/lib/digestif -I /home/opam/.opam/4.14/lib/eqaf -I /home/opam/.opam/4.14/lib/logs -I /home/opam/.opam/4.14/lib/mirage-crypto -I /home/opam/.opam/4.14/lib/mirage-crypto-rng -I /home/opam/.opam/4.14/lib/mirage-crypto-rng/unix -I /home/opam/.opam/4.14/lib/ocaml/threads -intf-suffix .ml -no-alias-deps -open Passe__ -o src/.passe.objs/byte/passe__Argon2.cmo -c -impl src/argon2.ml)
# File "src/argon2.ml", line 33, characters 20-30:
# 33 | let max_time_cost = 2147483647
#                          ^^^^^^^^^^
# Error: Integer literal exceeds the range of representable integers of type int
# (cd _build/default && /home/opam/.opam/4.14/bin/ocamlopt.opt -w -40 -g -I src/.passe.objs/byte -I src/.passe.objs/native -I /home/opam/.opam/4.14/lib/digestif -I /home/opam/.opam/4.14/lib/eqaf -I /home/opam/.opam/4.14/lib/logs -I /home/opam/.opam/4.14/lib/mirage-crypto -I /home/opam/.opam/4.14/lib/mirage-crypto-rng -I /home/opam/.opam/4.14/lib/mirage-crypto-rng/unix -I /home/opam/.opam/4.14/lib/ocaml/threads -intf-suffix .ml -no-alias-deps -open Passe__ -o src/.passe.objs/native/passe__Argon2.cmx -c -impl src/argon2.ml)
# File "src/argon2.ml", line 33, characters 20-30:
# 33 | let max_time_cost = 2147483647
#                          ^^^^^^^^^^
# Error: Integer literal exceeds the range of representable integers of type int

One could lower this max - or simply disable this early version on 32-bit. 🤔

@syaiful6
Copy link
Author

thank @jmid, I will release a new version to address this.

CHANGES:

Initial release of passe, includes:

- Bcrypt hash and verify functions
- Argon2 hash and verify functions
@syaiful6 syaiful6 force-pushed the release-passe-0.1.0 branch from 7cf44dd to 652ab3a Compare January 17, 2026 02:13
@syaiful6
Copy link
Author

@jmid I try to edit our opam metadata instead, and went added lower bounds for mirage crypto and disable 32-bit systems, in next release we will try support it and add mirage crypto lower bounds to our repository.

Is this accepted fix at the moment? or do I need to re-release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants