@@ -786,15 +786,12 @@ impl FuzzerBuilder {
786786 ///
787787 /// # Arguments
788788 /// * `scalar` - The scalar value to multiply
789- /// * `is_infinite` - The boolean value indicating if the resulting point is on the curve (setting it by ourself)
790789 ///
791790 /// # Returns
792- /// [`Point`] corresponding to `value` * G with overwritten on_curve value
793- pub fn base_scalar_mul ( & mut self , scalar : Scalar , is_infinite : TypedValue ) -> Point {
791+ /// [`Point`] corresponding to `value` * G
792+ pub fn base_scalar_mul ( & mut self , scalar : Scalar ) -> Point {
794793 assert ! ( scalar. validate( ) ) ;
795- assert ! ( matches!( is_infinite. type_of_variable, Type :: Numeric ( NumericType :: Boolean ) ) ) ;
796794 let field_type = Type :: Numeric ( NumericType :: Field ) ;
797- let boolean_type = Type :: Numeric ( NumericType :: Boolean ) ;
798795 let intrinsic = self
799796 . builder
800797 . import_intrinsic ( "multi_scalar_mul" )
@@ -809,16 +806,11 @@ impl FuzzerBuilder {
809806 . unwrap ( ) ,
810807 NumericType :: Field . into ( ) ,
811808 ) ;
812- let is_infinite_g_id = self . builder . numeric_constant ( 0_u32 , NumericType :: Boolean . into ( ) ) ;
813- let elements = vec ! [ g_x_id, g_y_id, is_infinite_g_id] . into_iter ( ) . collect ( ) ;
809+ let elements = vec ! [ g_x_id, g_y_id] . into_iter ( ) . collect ( ) ;
814810 let basic_point = self . builder . insert_make_array (
815811 elements,
816812 SsaType :: Array (
817- Arc :: new ( vec ! [
818- field_type. clone( ) . into( ) ,
819- field_type. clone( ) . into( ) ,
820- boolean_type. clone( ) . into( ) ,
821- ] ) ,
813+ Arc :: new ( vec ! [ field_type. clone( ) . into( ) , field_type. clone( ) . into( ) ] ) ,
822814 SemanticLength ( 1 ) ,
823815 ) ,
824816 ) ;
@@ -829,8 +821,7 @@ impl FuzzerBuilder {
829821 SemanticLength ( 1 ) ,
830822 ) ,
831823 ) ;
832- let return_type =
833- Type :: Array ( Arc :: new ( vec ! [ field_type. clone( ) , field_type. clone( ) , boolean_type] ) , 1 ) ;
824+ let return_type = Type :: Array ( Arc :: new ( vec ! [ field_type. clone( ) , field_type. clone( ) ] ) , 1 ) ;
834825 let predicate = self . builder . numeric_constant ( 1_u32 , NumericType :: Boolean . into ( ) ) ;
835826 let result = self . builder . insert_call (
836827 intrinsic,
@@ -843,24 +834,18 @@ impl FuzzerBuilder {
843834 let y_idx = self . builder . numeric_constant ( 1_u32 , NumericType :: U32 . into ( ) ) ;
844835 let x = self . builder . insert_array_get ( result, x_idx, field_type. clone ( ) . into ( ) ) ;
845836 let y = self . builder . insert_array_get ( result, y_idx, field_type. clone ( ) . into ( ) ) ;
846- Point {
847- x : TypedValue :: new ( x, field_type. clone ( ) ) ,
848- y : TypedValue :: new ( y, field_type) ,
849- is_infinite,
850- }
837+ Point { x : TypedValue :: new ( x, field_type. clone ( ) ) , y : TypedValue :: new ( y, field_type) }
851838 }
852839
853- /// Creates a point from an affine x coordinate (scalar.lo, scalar.hi, is_infinite )
840+ /// Creates a point from an affine x coordinate (scalar.lo, scalar.hi)
854841 /// Mostly invalid
855842 /// # Arguments
856843 /// * `scalar` - The scalar value to take coordinates from
857- /// * `is_infinite` - The boolean value indicating if the resulting point is on the curve (setting it by ourself)
858844 /// # Returns
859- /// Point (scalar.lo, scalar.hi, is_infinite )
860- pub fn create_point_from_scalar ( & mut self , scalar : Scalar , is_infinite : TypedValue ) -> Point {
845+ /// Point (scalar.lo, scalar.hi)
846+ pub fn create_point_from_scalar ( & mut self , scalar : Scalar ) -> Point {
861847 assert ! ( scalar. validate( ) ) ;
862- assert ! ( matches!( is_infinite. type_of_variable, Type :: Numeric ( NumericType :: Boolean ) ) ) ;
863- Point { x : scalar. lo , y : scalar. hi , is_infinite }
848+ Point { x : scalar. lo , y : scalar. hi }
864849 }
865850
866851 pub fn multi_scalar_mul (
@@ -879,7 +864,6 @@ impl FuzzerBuilder {
879864 let predicate =
880865 self . builder . numeric_constant ( u32:: from ( predicate) , NumericType :: Boolean . into ( ) ) ;
881866 let field_type = Type :: Numeric ( NumericType :: Field ) ;
882- let boolean_type = Type :: Numeric ( NumericType :: Boolean ) ;
883867 let intrinsic = self
884868 . builder
885869 . import_intrinsic ( "multi_scalar_mul" )
@@ -889,11 +873,7 @@ impl FuzzerBuilder {
889873 let point_ids_array = self . builder . insert_make_array (
890874 point_ids. into_iter ( ) . collect ( ) ,
891875 SsaType :: Array (
892- Arc :: new ( vec ! [
893- field_type. clone( ) . into( ) ,
894- field_type. clone( ) . into( ) ,
895- boolean_type. clone( ) . into( ) ,
896- ] ) ,
876+ Arc :: new ( vec ! [ field_type. clone( ) . into( ) , field_type. clone( ) . into( ) ] ) ,
897877 SemanticLength ( points. len ( ) as u32 ) ,
898878 ) ,
899879 ) ;
@@ -904,10 +884,7 @@ impl FuzzerBuilder {
904884 SemanticLength ( scalars. len ( ) as u32 ) ,
905885 ) ,
906886 ) ;
907- let return_type = Type :: Array (
908- Arc :: new ( vec ! [ field_type. clone( ) , field_type. clone( ) , boolean_type. clone( ) ] ) ,
909- 1 ,
910- ) ;
887+ let return_type = Type :: Array ( Arc :: new ( vec ! [ field_type. clone( ) , field_type. clone( ) ] ) , 1 ) ;
911888 let result = self . builder . insert_call (
912889 intrinsic,
913890 vec ! [ point_ids_array, scalar_ids_array, predicate] ,
@@ -917,23 +894,15 @@ impl FuzzerBuilder {
917894 let result = result[ 0 ] ;
918895 let x_idx = self . builder . numeric_constant ( 0_u32 , NumericType :: U32 . into ( ) ) ;
919896 let y_idx = self . builder . numeric_constant ( 1_u32 , NumericType :: U32 . into ( ) ) ;
920- let is_infinite_idx = self . builder . numeric_constant ( 2_u32 , NumericType :: U32 . into ( ) ) ;
921897 let x = self . builder . insert_array_get ( result, x_idx, field_type. clone ( ) . into ( ) ) ;
922898 let y = self . builder . insert_array_get ( result, y_idx, field_type. clone ( ) . into ( ) ) ;
923- let is_infinite =
924- self . builder . insert_array_get ( result, is_infinite_idx, boolean_type. clone ( ) . into ( ) ) ;
925- Point {
926- x : TypedValue :: new ( x, field_type. clone ( ) ) ,
927- y : TypedValue :: new ( y, field_type) ,
928- is_infinite : TypedValue :: new ( is_infinite, boolean_type) ,
929- }
899+ Point { x : TypedValue :: new ( x, field_type. clone ( ) ) , y : TypedValue :: new ( y, field_type) }
930900 }
931901
932902 pub fn point_add ( & mut self , p1 : Point , p2 : Point , predicate : bool ) -> Point {
933903 assert ! ( p1. validate( ) ) ;
934904 assert ! ( p2. validate( ) ) ;
935905 let field_type = Type :: Numeric ( NumericType :: Field ) ;
936- let boolean_type = Type :: Numeric ( NumericType :: Boolean ) ;
937906 let predicate =
938907 self . builder . numeric_constant ( u32:: from ( predicate) , NumericType :: Boolean . into ( ) ) ;
939908 let intrinsic = self
@@ -942,25 +911,15 @@ impl FuzzerBuilder {
942911 . expect ( "embedded_curve_add intrinsic should be available" ) ;
943912 let mut arguments = p1. to_id_vec ( ) . into_iter ( ) . chain ( p2. to_id_vec ( ) ) . collect :: < Vec < _ > > ( ) ;
944913 arguments. push ( predicate) ;
945- let return_type = Type :: Array (
946- Arc :: new ( vec ! [ field_type. clone( ) , field_type. clone( ) , boolean_type. clone( ) ] ) ,
947- 1 ,
948- ) ;
914+ let return_type = Type :: Array ( Arc :: new ( vec ! [ field_type. clone( ) , field_type. clone( ) ] ) , 1 ) ;
949915 let result = self . builder . insert_call ( intrinsic, arguments, vec ! [ return_type. into( ) ] ) ;
950916 assert_eq ! ( result. len( ) , 1 ) ;
951917 let result = result[ 0 ] ;
952918 let x_idx = self . builder . numeric_constant ( 0_u32 , NumericType :: U32 . into ( ) ) ;
953919 let y_idx = self . builder . numeric_constant ( 1_u32 , NumericType :: U32 . into ( ) ) ;
954- let is_infinite_idx = self . builder . numeric_constant ( 2_u32 , NumericType :: U32 . into ( ) ) ;
955920 let x = self . builder . insert_array_get ( result, x_idx, field_type. clone ( ) . into ( ) ) ;
956921 let y = self . builder . insert_array_get ( result, y_idx, field_type. clone ( ) . into ( ) ) ;
957- let is_infinite =
958- self . builder . insert_array_get ( result, is_infinite_idx, boolean_type. clone ( ) . into ( ) ) ;
959- Point {
960- x : TypedValue :: new ( x, field_type. clone ( ) ) ,
961- y : TypedValue :: new ( y, field_type) ,
962- is_infinite : TypedValue :: new ( is_infinite, boolean_type) ,
963- }
922+ Point { x : TypedValue :: new ( x, field_type. clone ( ) ) , y : TypedValue :: new ( y, field_type) }
964923 }
965924
966925 fn bytes_to_ssa_array ( & mut self , vec : Vec < u8 > ) -> TypedValue {
0 commit comments