8373231: ECDSAOperations::toAffinePoint is redundant

Reviewed-by: mullan
This commit is contained in:
John Jiang 2026-01-10 00:52:34 +00:00
parent 74faf03312
commit a726e834b6
2 changed files with 4 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -68,7 +68,7 @@ public class ECDSAOperations {
public ECDSAOperations(ECOperations ecOps, ECPoint basePoint) {
this.ecOps = ecOps;
this.basePoint = toAffinePoint(basePoint, ecOps.getField());
this.basePoint = AffinePoint.fromECPoint(basePoint, ecOps.getField());
}
public ECOperations getEcOperations() {
@ -79,14 +79,6 @@ public class ECDSAOperations {
return ecOps.multiply(basePoint, scalar).asAffine();
}
public static AffinePoint toAffinePoint(ECPoint point,
IntegerFieldModuloP field) {
ImmutableIntegerModuloP affineX = field.getElement(point.getAffineX());
ImmutableIntegerModuloP affineY = field.getElement(point.getAffineY());
return new AffinePoint(affineX, affineY);
}
public static
Optional<ECDSAOperations> forParameters(ECParameterSpec ecParams) {
Optional<ECOperations> curveOps =

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -249,7 +249,7 @@ public class ECDSAPrimitive {
byte[] u1Bytes = u1.asByteArray(length);
byte[] u2Bytes = u2.asByteArray(length);
AffinePoint publicKeyPoint = ECDSAOperations.toAffinePoint(publicKey,
AffinePoint publicKeyPoint = AffinePoint.fromECPoint(publicKey,
ecOps.getField());
MutablePoint R = ecOps.multiply(publicKeyPoint, u2Bytes);
AffinePoint a1 = ops.basePointMultiply(u1Bytes);