1
0
mirror of synced 2024-11-28 00:20:48 +01:00

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

View File

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

View File

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

View File

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