Skip to content

Commit

Permalink
extend pair count to 2 for not using pippengers for g1 / g2 msm
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Dec 13, 2024
1 parent ee878ef commit c864355
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public static int eip2537_perform_operation(
o_len.setValue(128);
break;
case BLS12_G1MULTIEXP_OPERATION_SHIM_VALUE:
if (i.length <= 192) {
// for pair count <= 2, use straight add/mul loop:
if (i.length <= 192 * 2) {
ret = eip2537blsG1MultiExp(i, output, err, i_len,
EIP2537_PREALLOCATE_FOR_RESULT_BYTES, EIP2537_PREALLOCATE_FOR_ERROR_BYTES);
} else {
Expand All @@ -87,7 +88,8 @@ public static int eip2537_perform_operation(
o_len.setValue(256);
break;
case BLS12_G2MULTIEXP_OPERATION_SHIM_VALUE:
if (i.length <= 288) {
// for pair count <= 2, use straight add/mul loop:
if (i.length <= 288 * 2) {
ret = eip2537blsG2MultiExp(i, output, err, i_len,
EIP2537_PREALLOCATE_FOR_RESULT_BYTES,
EIP2537_PREALLOCATE_FOR_ERROR_BYTES);
Expand Down

0 comments on commit c864355

Please sign in to comment.