mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-08 21:59:10 +02:00
begin ECDSA
This commit is contained in:
26
group.h
26
group.h
@@ -39,6 +39,14 @@ public:
|
||||
y.SetNeg(y, 1);
|
||||
}
|
||||
|
||||
void GetX(FieldElem &xout) const {
|
||||
xout = x;
|
||||
}
|
||||
|
||||
void GetY(FieldElem &yout) const {
|
||||
yout = y;
|
||||
}
|
||||
|
||||
std::string ToString() const {
|
||||
if (fInfinity)
|
||||
return "(inf)";
|
||||
@@ -101,6 +109,24 @@ public:
|
||||
aff.y = y;
|
||||
}
|
||||
|
||||
void GetX(FieldElem &xout) {
|
||||
FieldElem zi;
|
||||
zi.SetInverse(z);
|
||||
zi.SetSquare(zi);
|
||||
xout.SetMult(x, zi);
|
||||
}
|
||||
|
||||
bool IsInfinity() const {
|
||||
return fInfinity;
|
||||
}
|
||||
|
||||
void GetY(FieldElem &yout) {
|
||||
FieldElem zi;
|
||||
zi.SetInverse(z);
|
||||
FieldElem zi3; zi3.SetSquare(zi); zi3.SetMult(zi, zi3);
|
||||
yout.SetMult(y, zi3);
|
||||
}
|
||||
|
||||
void SetNeg(const GroupElemJac &p) {
|
||||
*this = p;
|
||||
y.Normalize();
|
||||
|
||||
Reference in New Issue
Block a user