@@ -128,3 +128,81 @@ func TestRunEcEmbeddedSecpOk(t *testing.T) {
128128 }
129129
130130}
131+
132+ func TestEcMulInnerSuccessEven (t * testing.T ) {
133+ vm := NewVirtualMachine ()
134+ vm .Segments .AddSegment ()
135+ vm .Segments .AddSegment ()
136+
137+ scalar := NewMaybeRelocatableFelt (FeltFromUint64 (89712 ))
138+ idsManager := SetupIdsForTest (
139+ map [string ][]* MaybeRelocatable {
140+ "scalar" : {scalar },
141+ },
142+ vm ,
143+ )
144+
145+ hintProcessor := CairoVmHintProcessor {}
146+
147+ hintData := any (HintData {
148+ Ids : idsManager ,
149+ Code : EC_MUL_INNER ,
150+ })
151+
152+ vm .RunContext .Ap = NewRelocatable (1 , 1 )
153+
154+ err := hintProcessor .ExecuteHint (vm , & hintData , nil , nil )
155+ result , err := vm .Segments .Memory .Get (NewRelocatable (1 , 1 ))
156+
157+ if err != nil {
158+ t .Errorf ("EC_MUL_INNER hint failed with error %s" , err )
159+ }
160+
161+ resultFelt , ok := result .GetFelt ()
162+ if ! ok {
163+ t .Errorf ("EC_MUL_INNER hint expected Felt value as result" )
164+ }
165+
166+ if ! resultFelt .IsZero () {
167+ t .Errorf ("EC_MUL_INNER should have returned 0 but got %v" , resultFelt )
168+ }
169+ }
170+
171+ func TestEcMulInnerSuccessOdd (t * testing.T ) {
172+ vm := NewVirtualMachine ()
173+ vm .Segments .AddSegment ()
174+ vm .Segments .AddSegment ()
175+
176+ scalar := NewMaybeRelocatableFelt (FeltFromUint64 (89711 ))
177+ idsManager := SetupIdsForTest (
178+ map [string ][]* MaybeRelocatable {
179+ "scalar" : {scalar },
180+ },
181+ vm ,
182+ )
183+
184+ hintProcessor := CairoVmHintProcessor {}
185+
186+ hintData := any (HintData {
187+ Ids : idsManager ,
188+ Code : EC_MUL_INNER ,
189+ })
190+
191+ vm .RunContext .Ap = NewRelocatable (1 , 1 )
192+
193+ err := hintProcessor .ExecuteHint (vm , & hintData , nil , nil )
194+ result , err := vm .Segments .Memory .Get (NewRelocatable (1 , 1 ))
195+
196+ if err != nil {
197+ t .Errorf ("EC_MUL_INNER hint failed with error %s" , err )
198+ }
199+
200+ resultFelt , ok := result .GetFelt ()
201+ if ! ok {
202+ t .Errorf ("EC_MUL_INNER hint expected Felt value as result" )
203+ }
204+
205+ if resultFelt .Cmp (FeltOne ()) != 0 {
206+ t .Errorf ("EC_MUL_INNER should have returned 1 but got %v" , resultFelt )
207+ }
208+ }
0 commit comments