package octez-libs
A package that contains multiple base libraries used by the Octez suite
Install
Dune Dependency
Authors
Maintainers
Sources
octez-19.1.tar.gz
sha256=55ea1fb8bb3273a7fc270ca8f650d45c56449665619482aad9bc12f3ea736b7e
sha512=fec850fc2d17d7490bbabd5147d62aad13b3aaed8774270f8a38ab419670ed03e0fd30cf8642a97984eca5c2446726fe590ad99c015f7ec50919dc7652f25053
doc/src/octez-libs.bls12-381-hash/jive.ml.html
Source file jive.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
let digest_b (type p) (module P : S.PERMUTATION with type parameters = p) (parameters : p) input b = let state_size = Array.length input in if state_size mod b != 0 then failwith "b must divide the state size" ; let m = state_size / b in let ctxt = P.allocate_ctxt parameters in let () = P.set_state ctxt input in let () = P.apply_permutation ctxt in let final_state = P.get_state ctxt in let output = Array.init m (fun _ -> Bls12_381.Fr.(copy zero)) in let rec aux i j = if i = m then output else if j = b then aux (i + 1) 0 else ( Bls12_381.Fr.add_inplace output.(i) output.(i) (Bls12_381.Fr.add final_state.(i + (m * j)) input.(i + (m * j))) ; aux i (j + 1)) in aux 0 0 let digest (type p) (module P : S.PERMUTATION with type parameters = p) (parameters : p) input = let res = digest_b (module P) parameters input (Array.length input) in res.(0)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>