Skip to content

Commit 67602ef

Browse files
committed
tezos-crypto compatible with OCaml 4.12
1 parent 46f0366 commit 67602ef

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
diff --git a/src/lib_crypto/dal/dal_cryptobox.ml b/src/lib_crypto/dal/dal_cryptobox.ml
2+
index f5675497c9..b141337e5a 100644
3+
--- a/src/lib_crypto/dal/dal_cryptobox.ml
4+
+++ b/src/lib_crypto/dal/dal_cryptobox.ml
5+
@@ -695,25 +695,25 @@ module Make (C : CONSTANTS) = struct
6+
7+
let _save_precompute_shards_proofs (preprocess : shards_proofs_precomputation)
8+
filename =
9+
- let chan = Out_channel.open_bin filename in
10+
- Out_channel.output_bytes
11+
+ let chan = Stdlib.open_out_bin filename in
12+
+ Stdlib.output_bytes
13+
chan
14+
(Data_encoding.Binary.to_bytes_exn
15+
Encoding.shards_proofs_precomputation_encoding
16+
preprocess) ;
17+
- Out_channel.close_noerr chan
18+
+ Stdlib.close_out_noerr chan
19+
20+
let _load_precompute_shards_proofs filename =
21+
- let chan = In_channel.open_bin filename in
22+
- let len = Int64.to_int (In_channel.length chan) in
23+
+ let chan = Stdlib.open_in_bin filename in
24+
+ let len = Int64.to_int (Stdlib.LargeFile.in_channel_length chan) in
25+
let data = Bytes.create len in
26+
- let (_ : unit option) = In_channel.really_input chan data 0 len in
27+
+ let () = try Stdlib.really_input chan data 0 len with End_of_file -> () in
28+
let precomp =
29+
Data_encoding.Binary.of_bytes_exn
30+
Encoding.shards_proofs_precomputation_encoding
31+
data
32+
in
33+
- In_channel.close_noerr chan ;
34+
+ Stdlib.close_in_noerr chan ;
35+
precomp
36+
37+
let prove_shards srs p =

packages/tezos-crypto/tezos-crypto.14.0/opam

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ depends: [
2525
"alcotest-lwt" { with-test & >= "1.5.0" }
2626
"tezos-bls12-381-polynomial" { >= "0.1.0" }
2727
]
28+
patches: ["crypto_for_ocaml12.diff"]
2829
build: [
2930
["rm" "-r" "vendors"]
3031
["dune" "build" "-p" name "-j" jobs]
3132
["dune" "runtest" "-p" name "-j" jobs] {with-test}
3233
]
3334
synopsis: "Tezos: library with all the cryptographic primitives used by Tezos"
35+
extra-files:
36+
[ "crypto_for_ocaml12.diff" "sha256=f8af55657c5c478b47cd4e13dd352a8367f189cca3419a783b1b00f638272681" ]
3437
url {
3538
src: "https://gitlab.com/tezos/tezos/-/archive/v14.0/tezos-v14.0.tar.bz2"
3639
checksum: [

0 commit comments

Comments
 (0)