}),
nil,
nil,
+ nil,
)
if err != nil {
t.FailNow()
bytes2big(y),
nil,
nil,
+ nil,
)
if err != nil {
t.FailNow()
bigInt1 *big.Int = big.NewInt(1)
bigInt2 *big.Int = big.NewInt(2)
bigInt3 *big.Int = big.NewInt(3)
+ bigInt4 *big.Int = big.NewInt(4)
)
type Curve struct {
P *big.Int // Characteristic of the underlying prime field
Q *big.Int // Elliptic curve subgroup order
+ Co *big.Int // Cofactor
+
// Equation coefficients of the elliptic curve in canonical form
A *big.Int
B *big.Int
edT *big.Int
}
-func NewCurve(p, q, a, b, x, y, e, d *big.Int) (*Curve, error) {
+func NewCurve(p, q, a, b, x, y, e, d, co *big.Int) (*Curve, error) {
c := Curve{
Name: "unknown",
P: p,
c.E = e
c.D = d
}
+ if co == nil {
+ c.Co = bigInt1
+ } else {
+ c.Co = co
+ }
return &c, nil
}
}),
nil,
nil,
+ nil,
)
if err != nil {
panic(err)
}),
nil,
nil,
+ nil,
)
if err != nil {
panic(err)
}),
nil,
nil,
+ nil,
)
if err != nil {
panic(err)
}),
nil,
nil,
+ nil,
)
if err != nil {
panic(err)
}),
nil,
nil,
+ nil,
)
if err != nil {
panic(err)
0x2B, 0x9D, 0xF6, 0x28, 0x97, 0x00, 0x9A, 0xF7,
0xE5, 0x22, 0xC3, 0x2D, 0x6D, 0xC7, 0xBF, 0xFB,
}),
+ bigInt4,
)
if err != nil {
panic(err)
}),
nil,
nil,
+ nil,
)
if err != nil {
panic(err)
}),
nil,
nil,
+ nil,
)
if err != nil {
panic(err)
0x91, 0xA0, 0xCF, 0xC2, 0xBC, 0x2A, 0x22, 0xB4,
0xCA, 0x30, 0x2D, 0xBB, 0x33, 0xEE, 0x75, 0x50,
}),
+ bigInt4,
)
if err != nil {
panic(err)
if err != nil {
return nil, err
}
+ ukm = ukm.Mul(ukm, prv.C.Co)
if ukm.Cmp(bigInt1) != 0 {
keyX, keyY, err = prv.C.Exp(ukm, keyX, keyY)
if err != nil {
@node Download
@unnumbered Download
-@set VERSION 4.2.4
+@set VERSION 4.3.0
Preferable way is to download tarball with the signature from
website and, for example, run tests with benchmarks:
@table @strong
+@anchor{Release 4.3.0}
+@item 4.3.0
+ @strong{Fixed} nasty bug with Edwards curves using in 34.10-VKO
+ functions: curve's cofactor has not been used.
+
@anchor{Release 4.2.4}
@item 4.2.4
@code{gost3410.PrivateKeyReverseDigest} reversed digests and