|
|
@ -227,7 +227,7 @@ struct FpGenerator : Xbyak::CodeGenerator { |
|
|
|
align(16); |
|
|
|
align(16); |
|
|
|
shr1_ = getCurr<void2op>(); |
|
|
|
shr1_ = getCurr<void2op>(); |
|
|
|
gen_shr1(); |
|
|
|
gen_shr1(); |
|
|
|
if (!op.isNIST_P192 && op.N <= 4) { // support general op.N but not fast for op.N > 4
|
|
|
|
if (op.primeMode != PM_NICT_P192 && op.N <= 4) { // support general op.N but not fast for op.N > 4
|
|
|
|
align(16); |
|
|
|
align(16); |
|
|
|
op.fp_preInv = getCurr<int2u>(); |
|
|
|
op.fp_preInv = getCurr<int2u>(); |
|
|
|
gen_preInv(); |
|
|
|
gen_preInv(); |
|
|
@ -600,7 +600,7 @@ struct FpGenerator : Xbyak::CodeGenerator { |
|
|
|
} |
|
|
|
} |
|
|
|
void gen_mul() |
|
|
|
void gen_mul() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (op_->isNIST_P192) { |
|
|
|
if (op_->primeMode == PM_NICT_P192) { |
|
|
|
StackFrame sf(this, 3, 10 | UseRDX, 8 * 6); |
|
|
|
StackFrame sf(this, 3, 10 | UseRDX, 8 * 6); |
|
|
|
mulPre3(rsp, sf.p[1], sf.p[2], sf.t); |
|
|
|
mulPre3(rsp, sf.p[1], sf.p[2], sf.t); |
|
|
|
fpDbl_mod_NIST_P192(sf.p[0], rsp, sf.t); |
|
|
|
fpDbl_mod_NIST_P192(sf.p[0], rsp, sf.t); |
|
|
@ -888,7 +888,7 @@ struct FpGenerator : Xbyak::CodeGenerator { |
|
|
|
} |
|
|
|
} |
|
|
|
void gen_fpDbl_mod(const mcl::fp::Op& op) |
|
|
|
void gen_fpDbl_mod(const mcl::fp::Op& op) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (op.isNIST_P192) { |
|
|
|
if (op.primeMode == PM_NICT_P192) { |
|
|
|
StackFrame sf(this, 2, 6 | UseRDX); |
|
|
|
StackFrame sf(this, 2, 6 | UseRDX); |
|
|
|
fpDbl_mod_NIST_P192(sf.p[0], sf.p[1], sf.t); |
|
|
|
fpDbl_mod_NIST_P192(sf.p[0], sf.p[1], sf.t); |
|
|
|
return; |
|
|
|
return; |
|
|
@ -909,7 +909,7 @@ struct FpGenerator : Xbyak::CodeGenerator { |
|
|
|
} |
|
|
|
} |
|
|
|
void gen_sqr() |
|
|
|
void gen_sqr() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (op_->isNIST_P192) { |
|
|
|
if (op_->primeMode == PM_NICT_P192) { |
|
|
|
StackFrame sf(this, 2, 10 | UseRDX | UseRCX, 8 * 6); |
|
|
|
StackFrame sf(this, 2, 10 | UseRDX | UseRCX, 8 * 6); |
|
|
|
sqrPre3(rsp, sf.p[1], sf.t); |
|
|
|
sqrPre3(rsp, sf.p[1], sf.t); |
|
|
|
fpDbl_mod_NIST_P192(sf.p[0], rsp, sf.t); |
|
|
|
fpDbl_mod_NIST_P192(sf.p[0], rsp, sf.t); |
|
|
|