Skip to content

Commit a1cebba

Browse files
committed
8373231: ECDSAOperations::toAffinePoint is redundant
1 parent 5f083ab commit a1cebba

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/java.base/share/classes/sun/security/ec/ECDSAOperations.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@ public byte[] getNonceValue() {
6868

6969
public ECDSAOperations(ECOperations ecOps, ECPoint basePoint) {
7070
this.ecOps = ecOps;
71-
this.basePoint = toAffinePoint(basePoint, ecOps.getField());
71+
this.basePoint = AffinePoint.fromECPoint(basePoint, ecOps.getField());
7272
}
7373

7474
public ECOperations getEcOperations() {
@@ -79,14 +79,6 @@ public AffinePoint basePointMultiply(byte[] scalar) {
7979
return ecOps.multiply(basePoint, scalar).asAffine();
8080
}
8181

82-
public static AffinePoint toAffinePoint(ECPoint point,
83-
IntegerFieldModuloP field) {
84-
85-
ImmutableIntegerModuloP affineX = field.getElement(point.getAffineX());
86-
ImmutableIntegerModuloP affineY = field.getElement(point.getAffineY());
87-
return new AffinePoint(affineX, affineY);
88-
}
89-
9082
public static
9183
Optional<ECDSAOperations> forParameters(ECParameterSpec ecParams) {
9284
Optional<ECOperations> curveOps =

test/jdk/sun/security/ec/ECDSAPrimitive.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -249,7 +249,7 @@ private static boolean verifySignedDigestImpl(ECDSAOperations ops, ECPoint publi
249249

250250
byte[] u1Bytes = u1.asByteArray(length);
251251
byte[] u2Bytes = u2.asByteArray(length);
252-
AffinePoint publicKeyPoint = ECDSAOperations.toAffinePoint(publicKey,
252+
AffinePoint publicKeyPoint = AffinePoint.fromECPoint(publicKey,
253253
ecOps.getField());
254254
MutablePoint R = ecOps.multiply(publicKeyPoint, u2Bytes);
255255
AffinePoint a1 = ops.basePointMultiply(u1Bytes);

0 commit comments

Comments
 (0)