From 5299a4477701e848035ee23f6e53a4718dcabfea Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 26 Jul 2023 19:19:53 -0400 Subject: [PATCH] Rename CurveX/Y to PublicKeyX/Y Thanks to @Slendy for a better name https://canary.discord.com/channels/1049223665243389953/1049225857350254632/1133900166475284510 --- NPTicket.Test/LbpSigningKey.cs | 4 ++-- NPTicket/Verification/ITicketSigningKey.cs | 4 ++-- NPTicket/Verification/Keys/PsnSigningKey.cs | 4 ++-- NPTicket/Verification/Keys/RpcnSigningKey.cs | 4 ++-- NPTicket/Verification/TicketVerifier.cs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/NPTicket.Test/LbpSigningKey.cs b/NPTicket.Test/LbpSigningKey.cs index 66f0dbd..0f1bc65 100644 --- a/NPTicket.Test/LbpSigningKey.cs +++ b/NPTicket.Test/LbpSigningKey.cs @@ -4,6 +4,6 @@ namespace NPTicket.Test; public class LbpSigningKey : PsnSigningKey { - public override string CurveX => "39c62d061d4ee35c5f3f7531de0af3cf918346526edac727"; - public override string CurveY => "a5d578b55113e612bf1878d4cc939d61a41318403b5bdf86"; + public override string PublicKeyX => "39c62d061d4ee35c5f3f7531de0af3cf918346526edac727"; + public override string PublicKeyY => "a5d578b55113e612bf1878d4cc939d61a41318403b5bdf86"; } \ No newline at end of file diff --git a/NPTicket/Verification/ITicketSigningKey.cs b/NPTicket/Verification/ITicketSigningKey.cs index 0a0528c..c2c49f2 100644 --- a/NPTicket/Verification/ITicketSigningKey.cs +++ b/NPTicket/Verification/ITicketSigningKey.cs @@ -8,6 +8,6 @@ public interface ITicketSigningKey string HashAlgorithm { get; } string CurveTable { get; } TicketSignatureMessageType MessageType { get; } - string CurveX { get; } - string CurveY { get; } + string PublicKeyX { get; } + string PublicKeyY { get; } } \ No newline at end of file diff --git a/NPTicket/Verification/Keys/PsnSigningKey.cs b/NPTicket/Verification/Keys/PsnSigningKey.cs index b58cad6..ae15b31 100644 --- a/NPTicket/Verification/Keys/PsnSigningKey.cs +++ b/NPTicket/Verification/Keys/PsnSigningKey.cs @@ -9,6 +9,6 @@ public abstract class PsnSigningKey : ITicketSigningKey public string HashAlgorithm => "SHA-1"; public string CurveTable => "secp192r1"; public TicketSignatureMessageType MessageType => TicketSignatureMessageType.Ticket; - public abstract string CurveX { get; } - public abstract string CurveY { get; } + public abstract string PublicKeyX { get; } + public abstract string PublicKeyY { get; } } \ No newline at end of file diff --git a/NPTicket/Verification/Keys/RpcnSigningKey.cs b/NPTicket/Verification/Keys/RpcnSigningKey.cs index e968441..341a74c 100644 --- a/NPTicket/Verification/Keys/RpcnSigningKey.cs +++ b/NPTicket/Verification/Keys/RpcnSigningKey.cs @@ -11,6 +11,6 @@ private RpcnSigningKey() {} public string HashAlgorithm => "SHA-224"; public string CurveTable => "secp224k1"; public TicketSignatureMessageType MessageType => TicketSignatureMessageType.Body; - public string CurveX => "b07bc0f0addb97657e9f389039e8d2b9c97dc2a31d3042e7d0479b93"; - public string CurveY => "d81c42b0abdf6c42191a31e31f93342f8f033bd529c2c57fdb5a0a7d"; + public string PublicKeyX => "b07bc0f0addb97657e9f389039e8d2b9c97dc2a31d3042e7d0479b93"; + public string PublicKeyY => "d81c42b0abdf6c42191a31e31f93342f8f033bd529c2c57fdb5a0a7d"; } \ No newline at end of file diff --git a/NPTicket/Verification/TicketVerifier.cs b/NPTicket/Verification/TicketVerifier.cs index 97605cb..4d241a0 100644 --- a/NPTicket/Verification/TicketVerifier.cs +++ b/NPTicket/Verification/TicketVerifier.cs @@ -23,7 +23,7 @@ public TicketVerifier(byte[] ticketData, Ticket ticket, ITicketSigningKey key) X9ECParameters xParams = ECNamedCurveTable.GetByName(key.CurveTable); ECDomainParameters domainParams = new(xParams.Curve, xParams.G, xParams.N, xParams.H, xParams.GetSeed()); - ECPoint ecPoint = domainParams.Curve.CreatePoint(new BigInteger(key.CurveX, 16), new BigInteger(key.CurveY, 16)); + ECPoint ecPoint = domainParams.Curve.CreatePoint(new BigInteger(key.PublicKeyX, 16), new BigInteger(key.PublicKeyY, 16)); ECPublicKeyParameters publicKey = new ECPublicKeyParameters(ecPoint, domainParams); this._signer = SignerUtilities.GetSigner(key.HashAlgorithm + "withECDSA");