fix fp6 subtraction---fp12 tests running!

This commit is contained in:
Dmitry Vagner 2022-10-17 15:58:56 -04:00
parent a0f7e6619d
commit b534b221a0
2 changed files with 8 additions and 7 deletions

View File

@ -24,8 +24,8 @@ global test_mul_Fp12:
%jump(mul_Fp12)
return_on_stack:
// stack:
%load_fp6(24)
%load_fp6(30)
%load_fp6(24)
// stack: h, h'
%jump(0xdeadbeef)
@ -38,7 +38,7 @@ global mul_Fp12:
// stack: g', f', g', f'
%mul_fp6
%dup1_fp6
// stack: g'f', g'f', g', f'
// stack: f'g', f'g', g', f'
%store_fp6_sh(36)
%store_fp6(42)
// stack: g', f'
@ -50,21 +50,21 @@ global mul_Fp12:
// stack: g , g', g , f'
%add_fp6
// stack: g + g', g , f'
%jump(0xdeadbeef)
%swap_fp6
// stack: g , g + g', f'
%load_fp6(0)
// stack: f, g , g'+ g , f'
// stack: f, g , g + g', f'
%mul_fp6
%store_fp6(48)
// stack: g'+ g , f'
// stack: g + g', f'
%swap_fp6
%load_fp6(0)
%add_fp6
// stack: f'+ f, g'+ g
// stack: f+f', g+g'
%mul_fp6
// stack: (f+f')(g+g')
%load_fp6(42)
// stack: f'g', (f+f')(g+g')
%bus_fp6
// stack: (f+f')(g+g') - f'g'
%load_fp6(48)

View File

@ -162,7 +162,7 @@
// stack: h0, h1, h2, h3, h4, h5
%endmacro
// *backwards order subtraction* cost: 16
// *backwards order subtraction* cost: 17
%macro bus_fp6
// stack: f0, f1, f2, f3, f4, f5, g0, g1, g2, g3, g4, g5
SWAP7
@ -185,6 +185,7 @@
SUBFP254
SWAP6
// stack: f0, g0, h1, h2, h3, h4, h5
SWAP1
SUBFP254
// stack: h0, h1, h2, h3, h4, h5
%endmacro