Skip to content

Commit

Permalink
added ec_op
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineFONDEUR committed May 30, 2024
1 parent 4b0cfd1 commit c13d614
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/builtins/ec_op/ec_op.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ function ec_mul(m: bigint, p: AffinePoint): AffinePoint{
}
return res;
}

function ec_op(m: bigint, p: AffinePoint, q: AffinePoint): AffinePoint{
return ec_add(ec_mul(m,p),q);
}
4 changes: 4 additions & 0 deletions src/ui/Code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ function DECODE_INSTRUCTION(encodedInstruction: string): [any[]] {
function PEDERSEN(x: number | string, y: number | string): number | string {
return pedersen(BigInt(x), BigInt(y)).toString(16);
}

function EC_OP(m: number | string, p: AffinePoint, q: AffinePoint): AffinePoint{
return ec_op(BigInt(m),p,q);
}

0 comments on commit c13d614

Please sign in to comment.