LazyECPoint: JavaDoc for the constructors.

This commit is contained in:
Andreas Schildbach 2021-05-14 16:29:49 +02:00
parent ca8811e1f6
commit 4e4968ecb5

View File

@ -44,12 +44,25 @@ public class LazyECPoint {
@Nullable
private ECPoint point;
/**
* Construct a LazyECPoint from a public key. Due to the delayed decoding of the point the validation of the
* public key is delayed too, e.g. until a getter is called.
*
* @param curve a curve the point is on
* @param bits public key bytes
*/
public LazyECPoint(ECCurve curve, byte[] bits) {
this.curve = curve;
this.bits = bits;
this.compressed = ECKey.isPubKeyCompressed(bits);
}
/**
* Construct a LazyECPoint from an already decoded point.
*
* @param point the wrapped point
* @param compressed true if the represented public key is compressed
*/
public LazyECPoint(ECPoint point, boolean compressed) {
this.point = checkNotNull(point).normalize();
this.compressed = compressed;