mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8373231: ECDSAOperations::toAffinePoint is redundant
Reviewed-by: mullan
This commit is contained in:
parent
74faf03312
commit
a726e834b6
@ -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 =
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user