Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update arkworks to 0.4.2 (compatible) #15940

Merged
merged 6 commits into from
Sep 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/lib/pickles/wrap_verifier.ml
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,20 @@ struct
(* TODO: num_bits should maybe be input_length - 1. *)
Ops.bits_per_chunk * Ops.chunks_needed ~num_bits:input_length
in
let rec pow2pow x i =
if i = 0 then x else pow2pow Inner_curve.Constant.(x + x) (i - 1)
(* computes 2^i *)
dannywillems marked this conversation as resolved.
Show resolved Hide resolved
let rec field2pow f i =
if i = 1 then f
else
let j = i - 1 in
Inner_curve.Constant.Scalar.(f * field2pow f j)
in
(* computes 2^actual_shift *)
let two_to_actual_shift =
field2pow (Inner_curve.Constant.Scalar.of_int 2) actual_shift
in
(* computes [2^actual_shift] G *)
let field_to_two_to_shift g =
Inner_curve.Constant.scale g two_to_actual_shift
in
let base_and_correction (h : Domain.t) =
let d = Int.pow 2 (Domain.log2_size h) in
Expand All @@ -383,7 +395,7 @@ struct
let open Inner_curve.Constant in
let g = of_affine g in
( Inner_curve.constant g
, Inner_curve.constant (negate (pow2pow g actual_shift)) )
, Inner_curve.constant (negate (field_to_two_to_shift g)) )
| Infinity ->
(* Point at infinity should be impossible in the SRS *)
assert false )
Expand Down Expand Up @@ -1373,6 +1385,7 @@ struct

let challenge_polynomial = G.challenge_polynomial (module Field)

(* computes pt^{2^n} *)
let pow2pow (pt : Field.t) (n : int) : Field.t =
with_label __LOC__ (fun () ->
let rec go acc i =
Expand Down