Skip to content

Commit

Permalink
Fix ECIP completeness issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
feltroidprime committed Oct 15, 2024
1 parent 2857d96 commit 89e732a
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions src/ec_ops.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,34 @@ func compute_RHS_basis_sum{
if (index == n) {
return (res=sum);
}
let _ep = [scalars_epns];
let _en = [scalars_epns + 1];
let scalar = _ep - _en;
if (scalar == 0) {
return compute_RHS_basis_sum(
curve_id=curve_id,
acc_circuit=acc_circuit,
points=points,
scalars_epns=scalars_epns + 4,
index=index + 1,
n=n,
sum=sum,
constants=constants,
);
}
let (pt_is_inf) = G1Point_eq_zero(points[index]);
if (pt_is_inf == 1) {
return compute_RHS_basis_sum(
curve_id=curve_id,
acc_circuit=acc_circuit,
points=points,
scalars_epns=scalars_epns + 4,
index=index + 1,
n=n,
sum=sum,
constants=constants,
);
}
let (local input: UInt384*) = alloc();
assert input[0] = sum; // Copy previous sum to accumulate.
// Copy only m_A0, b_A0, xA0 from SlopeInterceptOutput struct.
Expand All @@ -272,8 +300,8 @@ func compute_RHS_basis_sum{
G1Point.SIZE,
);
// Copy i-th scalar's positive and negative parts.
let (ep) = felt_to_UInt384([scalars_epns]);
let (en) = felt_to_UInt384([scalars_epns + 1]);
let (ep) = felt_to_UInt384(_ep);
let (en) = felt_to_UInt384(_en);
let (sp) = sign_to_UInt384([scalars_epns + 2], curve_id);
let (sn) = sign_to_UInt384([scalars_epns + 3], curve_id);

Expand Down

0 comments on commit 89e732a

Please sign in to comment.