Double-and-add
Reduction of scalar multiplication into double and add operations
Motivation
Algorithm Process
// Scalar multiplication: Double-and-Add
Point ScalarMultiply(Point p, int k) {
Point result; // point at infinity
Point powerOfP = p;
if (k & 1) {
result = result + powerOfP;
}
k >>= 1;
while (k > 0) {
powerOfP = powerOfP.Double();
if (k & 1) {
result = result + powerOfP;
}
k >>= 1;
}
return result;
}Last updated