ECDSA rename signature format "Concat HEX" to "P1363 HEX"

this format name is more specific and easier to search for on the internet
This commit is contained in:
CPlusSharp 2024-04-14 11:34:59 +02:00
parent 8f182e4a9b
commit 7b54d9e873
4 changed files with 27 additions and 27 deletions

View File

@ -47,7 +47,7 @@ class ECDSASign extends Operation {
type: "option", type: "option",
value: [ value: [
"ASN.1 HEX", "ASN.1 HEX",
"Concat HEX", "P1363 HEX",
"JSON" "JSON"
] ]
} }
@ -83,7 +83,7 @@ class ECDSASign extends Operation {
case "ASN.1 HEX": case "ASN.1 HEX":
result = signatureASN1Hex; result = signatureASN1Hex;
break; break;
case "Concat HEX": case "P1363 HEX":
result = r.KJUR.crypto.ECDSA.asn1SigToConcatSig(signatureASN1Hex); result = r.KJUR.crypto.ECDSA.asn1SigToConcatSig(signatureASN1Hex);
break; break;
case "JSON": { case "JSON": {

View File

@ -31,7 +31,7 @@ class ECDSASignatureConversion extends Operation {
value: [ value: [
"Auto", "Auto",
"ASN.1 HEX", "ASN.1 HEX",
"Concat HEX", "P1363 HEX",
"JSON" "JSON"
] ]
}, },
@ -40,7 +40,7 @@ class ECDSASignatureConversion extends Operation {
type: "option", type: "option",
value: [ value: [
"ASN.1 HEX", "ASN.1 HEX",
"Concat HEX", "P1363 HEX",
"JSON" "JSON"
] ]
} }
@ -63,7 +63,7 @@ class ECDSASignatureConversion extends Operation {
} else if (input.indexOf("{") !== -1) { } else if (input.indexOf("{") !== -1) {
inputFormat = "JSON"; inputFormat = "JSON";
} else { } else {
inputFormat = "Concat HEX"; inputFormat = "P1363 HEX";
} }
} }
@ -73,7 +73,7 @@ class ECDSASignatureConversion extends Operation {
case "ASN.1 HEX": case "ASN.1 HEX":
signatureASN1Hex = input; signatureASN1Hex = input;
break; break;
case "Concat HEX": case "P1363 HEX":
signatureASN1Hex = r.KJUR.crypto.ECDSA.concatSigToASN1Sig(input); signatureASN1Hex = r.KJUR.crypto.ECDSA.concatSigToASN1Sig(input);
break; break;
case "JSON": { case "JSON": {
@ -89,7 +89,7 @@ class ECDSASignatureConversion extends Operation {
case "ASN.1 HEX": case "ASN.1 HEX":
result = signatureASN1Hex; result = signatureASN1Hex;
break; break;
case "Concat HEX": case "P1363 HEX":
result = r.KJUR.crypto.ECDSA.asn1SigToConcatSig(signatureASN1Hex); result = r.KJUR.crypto.ECDSA.asn1SigToConcatSig(signatureASN1Hex);
break; break;
case "JSON": { case "JSON": {

View File

@ -32,7 +32,7 @@ class ECDSAVerify extends Operation {
value: [ value: [
"Auto", "Auto",
"ASN.1 HEX", "ASN.1 HEX",
"Concat HEX", "P1363 HEX",
"JSON" "JSON"
] ]
}, },
@ -80,7 +80,7 @@ class ECDSAVerify extends Operation {
} else if (input.indexOf("{") !== -1) { } else if (input.indexOf("{") !== -1) {
inputFormat = "JSON"; inputFormat = "JSON";
} else { } else {
inputFormat = "Concat HEX"; inputFormat = "P1363 HEX";
} }
} }
@ -90,7 +90,7 @@ class ECDSAVerify extends Operation {
case "ASN.1 HEX": case "ASN.1 HEX":
signatureASN1Hex = input; signatureASN1Hex = input;
break; break;
case "Concat HEX": case "P1363 HEX":
signatureASN1Hex = r.KJUR.crypto.ECDSA.concatSigToASN1Sig(input); signatureASN1Hex = r.KJUR.crypto.ECDSA.concatSigToASN1Sig(input);
break; break;
case "JSON": { case "JSON": {

View File

@ -30,7 +30,7 @@ gusgcAE8H6810fkJ8ZmTNiCCa6sLgR2vD1VNh2diirWgKPH4PVMKav5e6Q==
signature: { signature: {
sha256: { sha256: {
asn1: "3046022100e06905608a2fa7dbda9e284c2a7959dfb68fb527a5f003b2d7975ff135145127022100b6baa253793334f8b93ea1dd622bc600124d8090babd807efe3f77b8b324388d", asn1: "3046022100e06905608a2fa7dbda9e284c2a7959dfb68fb527a5f003b2d7975ff135145127022100b6baa253793334f8b93ea1dd622bc600124d8090babd807efe3f77b8b324388d",
concat: "e06905608a2fa7dbda9e284c2a7959dfb68fb527a5f003b2d7975ff135145127b6baa253793334f8b93ea1dd622bc600124d8090babd807efe3f77b8b324388d", p1363: "e06905608a2fa7dbda9e284c2a7959dfb68fb527a5f003b2d7975ff135145127b6baa253793334f8b93ea1dd622bc600124d8090babd807efe3f77b8b324388d",
json: `{"r":"00e06905608a2fa7dbda9e284c2a7959dfb68fb527a5f003b2d7975ff135145127","s":"00b6baa253793334f8b93ea1dd622bc600124d8090babd807efe3f77b8b324388d"}` json: `{"r":"00e06905608a2fa7dbda9e284c2a7959dfb68fb527a5f003b2d7975ff135145127","s":"00b6baa253793334f8b93ea1dd622bc600124d8090babd807efe3f77b8b324388d"}`
} }
} }
@ -250,8 +250,8 @@ TestRegister.addTests([
] ]
}, },
{ {
name: "ECDSA Verify: P-256 with SHA256 (Concat signature)", name: "ECDSA Verify: P-256 with SHA256 (P1363 signature)",
input: P256.signature.sha256.concat, input: P256.signature.sha256.p1363,
expectedOutput: "Verified OK", expectedOutput: "Verified OK",
recipeConfig: [ recipeConfig: [
{ {
@ -307,13 +307,13 @@ TestRegister.addTests([
] ]
}, },
{ {
name: "ECDSA Signature Conversion: ASN.1 To Concat", name: "ECDSA Signature Conversion: ASN.1 To P1363",
input: P256.signature.sha256.asn1, input: P256.signature.sha256.asn1,
expectedOutput: P256.signature.sha256.concat, expectedOutput: P256.signature.sha256.p1363,
recipeConfig: [ recipeConfig: [
{ {
"op": "ECDSA Signature Conversion", "op": "ECDSA Signature Conversion",
"args": ["Auto", "Concat HEX"] "args": ["Auto", "P1363 HEX"]
} }
] ]
}, },
@ -329,8 +329,8 @@ TestRegister.addTests([
] ]
}, },
{ {
name: "ECDSA Signature Conversion: Concat To ASN.1", name: "ECDSA Signature Conversion: P1363 To ASN.1",
input: P256.signature.sha256.concat, input: P256.signature.sha256.p1363,
expectedOutput: P256.signature.sha256.asn1, expectedOutput: P256.signature.sha256.asn1,
recipeConfig: [ recipeConfig: [
{ {
@ -340,19 +340,19 @@ TestRegister.addTests([
] ]
}, },
{ {
name: "ECDSA Signature Conversion: Concat To Concat", name: "ECDSA Signature Conversion: P1363 To P1363",
input: P256.signature.sha256.concat, input: P256.signature.sha256.p1363,
expectedOutput: P256.signature.sha256.concat, expectedOutput: P256.signature.sha256.p1363,
recipeConfig: [ recipeConfig: [
{ {
"op": "ECDSA Signature Conversion", "op": "ECDSA Signature Conversion",
"args": ["Auto", "Concat HEX"] "args": ["Auto", "P1363 HEX"]
} }
] ]
}, },
{ {
name: "ECDSA Signature Conversion: Concat To JSON", name: "ECDSA Signature Conversion: P1363 To JSON",
input: P256.signature.sha256.concat, input: P256.signature.sha256.p1363,
expectedOutput: P256.signature.sha256.json, expectedOutput: P256.signature.sha256.json,
recipeConfig: [ recipeConfig: [
{ {
@ -373,13 +373,13 @@ TestRegister.addTests([
] ]
}, },
{ {
name: "ECDSA Signature Conversion: JSON To Concat", name: "ECDSA Signature Conversion: JSON To P1363",
input: P256.signature.sha256.json, input: P256.signature.sha256.json,
expectedOutput: P256.signature.sha256.concat, expectedOutput: P256.signature.sha256.p1363,
recipeConfig: [ recipeConfig: [
{ {
"op": "ECDSA Signature Conversion", "op": "ECDSA Signature Conversion",
"args": ["Auto", "Concat HEX"] "args": ["Auto", "P1363 HEX"]
} }
] ]
}, },