Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions src/java.base/share/classes/sun/security/ec/ECDSAOperations.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -68,7 +68,7 @@ public byte[] getNonceValue() {

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() {
Expand All @@ -79,14 +79,6 @@ public AffinePoint basePointMultiply(byte[] scalar) {
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 =
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/sun/security/ec/ECDSAPrimitive.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -249,7 +249,7 @@ private static boolean verifySignedDigestImpl(ECDSAOperations ops, ECPoint publi

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);
Expand Down