package octez-libs
A package that contains multiple base libraries used by the Octez suite
Install
Dune Dependency
Authors
Maintainers
Sources
tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
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)"
>