本文整理汇总了C++中ECn2::getZ方法的典型用法代码示例。如果您正苦于以下问题:C++ ECn2::getZ方法的具体用法?C++ ECn2::getZ怎么用?C++ ECn2::getZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ECn2
的用法示例。
在下文中一共展示了ECn2::getZ方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: line
ZZn12 line(ECn2& A,ECn2& C,ZZn2& slope,ZZn& Qx,ZZn& Qy)
{
ZZn12 w;
ZZn6 nn,dd;
ZZn2 X,Y;
#ifdef AFFINE
A.get(X,Y);
dd.set(slope*Qx,Y-slope*X);
nn.set((ZZn2)-Qy);
w.set(nn,dd);
#endif
#ifdef PROJECTIVE
ZZn2 Z,Z2,ZZ,ZZZ;
A.get(X,Y,Z);
C.getZ(Z2);
ZZ=Z*Z;
ZZZ=ZZ*Z;
dd.set((ZZZ*slope)*Qx,Z2*Y-Z*X*slope);
nn.set((ZZn2)-(ZZZ*Z2)*Qy);
w.set(nn,dd);
#endif
return w;
}
示例2: line
ZZn12 line(ECn2& A,ECn2& C,ECn2& B,ZZn2& slope,ZZn2& extra,BOOL Doubling,ZZn& Qx,ZZn& Qy)
{
ZZn12 w;
ZZn4 nn,dd;
ZZn2 X,Y;
ZZn2 Z3;
C.getZ(Z3);
// Thanks to A. Menezes for pointing out this optimization...
if (Doubling)
{
ZZn2 Z,ZZ;
A.get(X,Y,Z);
ZZ=Z; ZZ*=ZZ;
nn.set((Z3*ZZ)*Qy,slope*X-extra);
dd.set(-(ZZ*slope)*Qx);
}
else
{
ZZn2 X2,Y2;
B.get(X2,Y2);
nn.set(Z3*Qy,slope*X2-Y2*Z3);
dd.set(-slope*Qx);
}
w.set(nn,dd);
return w;
}
示例3: line
ZZn12 line(ECn2& A,ECn2& C,ECn2&B,ZZn2& slope,ZZn2& extra,BOOL Doubling,ZZn& Qx,ZZn& Qy)
{
ZZn12 w;
ZZn6 nn,dd;
ZZn2 X,Y;
#ifdef AFFINE
A.get(X,Y);
dd.set(slope*Qx,Y-slope*X);
nn.set((ZZn2)-Qy);
w.set(nn,dd);
#endif
#ifdef PROJECTIVE
ZZn2 Z3;
C.getZ(Z3);
// Thanks to A. Menezes for pointing out this optimization...
if (Doubling)
{
ZZn2 Z,ZZ;
A.get(X,Y,Z);
ZZ=Z; ZZ*=ZZ;
dd.set(-(ZZ*slope)*Qx,slope*X-extra);
nn.set((Z3*ZZ)*Qy);
}
else
{
ZZn2 X2,Y2;
B.get(X2,Y2);
dd.set(-slope*Qx,slope*X2-Y2*Z3);
nn.set(Z3*Qy);
}
w.set(nn,dd);
#endif
//cout << "w= " << w << endl;
return w;
}
示例4: line
ZZn12 line(ECn2& A,ECn2& C,ECn2& B,ZZn2& slope,ZZn2& extra,BOOL Doubling,ZZn& Qx,ZZn& Qy)
{
ZZn12 w;
ZZn4 nn,dd,cc;
ZZn2 X,Y;
#ifdef AFFINE
A.get(X,Y);
if (get_mip()->TWIST==MR_SEXTIC_M)
{
nn.set(txx((ZZn2)-Qy),Y-slope*X);
cc.seth(slope*Qx);
}
if (get_mip()->TWIST==MR_SEXTIC_D)
{
nn.set((ZZn2)-Qy,Y-slope*X);
dd.set(slope*Qx);
}
w.set(nn,dd,cc);
#endif
#ifdef PROJECTIVE
ZZn2 Z3;
C.getZ(Z3);
// Thanks to A. Menezes for pointing out this optimization...
if (Doubling)
{
ZZn2 Z,ZZ;
A.get(X,Y,Z);
ZZ=Z; ZZ*=ZZ;
if (get_mip()->TWIST==MR_SEXTIC_M)
{ // "multiplied across" by i to simplify
nn.set((Z3*ZZ)*txx((ZZn2)Qy),slope*X-extra);
cc.seth(-(ZZ*slope)*Qx);
}
if (get_mip()->TWIST==MR_SEXTIC_D)
{
nn.set((Z3*ZZ)*Qy,slope*X-extra);
dd.set(-(ZZ*slope)*Qx);
}
}
else
{
ZZn2 X2,Y2;
B.get(X2,Y2);
if (get_mip()->TWIST==MR_SEXTIC_M)
{
nn.set(Z3*txx((ZZn2)Qy),slope*X2-Y2*Z3);
cc.seth(-slope*Qx);
}
if (get_mip()->TWIST==MR_SEXTIC_D)
{
nn.set(Z3*Qy,slope*X2-Y2*Z3);
dd.set(-slope*Qx);
}
}
w.set(nn,dd,cc);
#endif
return w;
}