Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

OpenSSL::PKey::EC::Point#mul

point.mul(bn1 [, bn2]) => point
point.mul(bns, points [, bn2]) => point

Performs elliptic curve point multiplication.

The first form calculates bn1 * point + bn2 * G, where G is the generator of the group of point. bn2 may be omitted, and in that case, the result is just bn1 * point.

The second form calculates bns[0] * point + bns[1] * points[0] + ... + bns[-1] * points[-1] + bn2 * G. bn2 may be omitted. bns must be an array of OpenSSL::BN. points must be an array of OpenSSL::PKey::EC::Point. Please note that points[0] is not multiplied by bns[0], but bns[1].