Skip to content

Commit

Permalink
[Script] Add ec_point_fp_jacobi test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
smlu committed Nov 23, 2023
1 parent bd4731a commit 85882f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/scripts/ec_base_mul_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ def tv2str(tv: tuple, decl_vars: bool) -> str:
test_str += indent('REQUIRE_EQUAL( curve.generate_point<point_proj_type>( k ).to_affine(), r )', indent_size) + '\n'
test_str += indent(f'REQUIRE_EQUAL( curve.generate_point<point_proj_type>( "{ int_hex( tv[0] ) }" ).to_affine(), r )', indent_size) + '\n'
test_str += indent(f'REQUIRE_EQUAL( curve.generate_point<point_proj_type>( "{ int_hex( tv[0] ) }"sv ).to_affine(), r )', indent_size) + '\n'
test_str += indent('REQUIRE_EQUAL( curve.generate_point<point_jacobi_type>( k ).to_affine(), r )', indent_size) + '\n'
test_str += indent(f'REQUIRE_EQUAL( curve.generate_point<point_jacobi_type>( "{ int_hex( tv[0] ) }" ).to_affine(), r )', indent_size) + '\n'
test_str += indent(f'REQUIRE_EQUAL( curve.generate_point<point_jacobi_type>( "{ int_hex( tv[0] ) }"sv ).to_affine(), r )', indent_size) + '\n'
return test_str

def main():
Expand Down Expand Up @@ -170,6 +173,7 @@ def main():
print(indent(f'using bn_t = typename { curve_var[curve_name] }_t::int_type;', indent_size), file=f)
print(indent(f'const auto& curve = ack::ec_curve::{ curve_var[curve_name] };', indent_size), file=f)
print(indent(f'using point_proj_type = ack::ec_point_fp_proj<{ curve_var[curve_name] }_t>;', indent_size), file=f)
print(indent(f'using point_jacobi_type = ack::ec_point_fp_jacobi<{ curve_var[curve_name] }_t>;', indent_size), file=f)
print(indent( '{', indent_size), file=f )
print(indent( f'{ tcs.rstrip() }', indent_size), file=f )
print(indent( '}', indent_size), file=f )
Expand Down

0 comments on commit 85882f2

Please sign in to comment.