Skip to content

Commit f11e797

Browse files
committed
Add NoCofactor flag for cofactor-absent ECDH test cases
1 parent 6ee6d1c commit f11e797

14 files changed

+112
-56
lines changed

testvectors_v1/ecdh_brainpoolP224r1_test.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@
122122
"bugType": "MODIFIED_PARAMETER",
123123
"description": "The order of the public key has been modified.",
124124
"effect": "If this order is used in a cryptographic primitive instead of the correct order then an invalid curve attack is possible and the private keys may leak. E.g. ECDHC in BC 1.52 suffered from this."
125+
},
126+
"NoCofactor": {
127+
"bugType": "MISSING_PARAMETER",
128+
"description": "The cofactor field is absent from the ECParameters. RFC 3279 Section 2.3.5 requires the cofactor to be present."
125129
}
126130
},
127131
"testGroups": [
@@ -5994,9 +5998,9 @@
59945998
},
59955999
{
59966000
"tcId": 532,
5997-
"comment": "cofactor = 0",
6001+
"comment": "no cofactor",
59986002
"flags": [
5999-
"NegativeCofactor",
6003+
"NoCofactor",
60006004
"InvalidPublic",
60016005
"UnnamedCurve"
60026006
],
@@ -6033,9 +6037,9 @@
60336037
},
60346038
{
60356039
"tcId": 535,
6036-
"comment": "cofactor = None",
6040+
"comment": "no cofactor",
60376041
"flags": [
6038-
"ModifiedCofactor",
6042+
"NoCofactor",
60396043
"UnusedParam",
60406044
"UnnamedCurve"
60416045
],

testvectors_v1/ecdh_brainpoolP256r1_test.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@
126126
"bugType": "MODIFIED_PARAMETER",
127127
"description": "The order of the public key has been modified.",
128128
"effect": "If this order is used in a cryptographic primitive instead of the correct order then an invalid curve attack is possible and the private keys may leak. E.g. ECDHC in BC 1.52 suffered from this."
129+
},
130+
"NoCofactor": {
131+
"bugType": "MISSING_PARAMETER",
132+
"description": "The cofactor field is absent from the ECParameters. RFC 3279 Section 2.3.5 requires the cofactor to be present."
129133
}
130134
},
131135
"testGroups": [
@@ -6215,9 +6219,9 @@
62156219
},
62166220
{
62176221
"tcId": 551,
6218-
"comment": "cofactor = 0",
6222+
"comment": "no cofactor",
62196223
"flags": [
6220-
"NegativeCofactor",
6224+
"NoCofactor",
62216225
"InvalidPublic",
62226226
"UnnamedCurve"
62236227
],
@@ -6254,9 +6258,9 @@
62546258
},
62556259
{
62566260
"tcId": 554,
6257-
"comment": "cofactor = None",
6261+
"comment": "no cofactor",
62586262
"flags": [
6259-
"ModifiedCofactor",
6263+
"NoCofactor",
62606264
"UnusedParam",
62616265
"UnnamedCurve"
62626266
],

testvectors_v1/ecdh_brainpoolP320r1_test.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@
118118
"bugType": "MODIFIED_PARAMETER",
119119
"description": "The order of the public key has been modified.",
120120
"effect": "If this order is used in a cryptographic primitive instead of the correct order then an invalid curve attack is possible and the private keys may leak. E.g. ECDHC in BC 1.52 suffered from this."
121+
},
122+
"NoCofactor": {
123+
"bugType": "MISSING_PARAMETER",
124+
"description": "The cofactor field is absent from the ECParameters. RFC 3279 Section 2.3.5 requires the cofactor to be present."
121125
}
122126
},
123127
"testGroups": [
@@ -5847,9 +5851,9 @@
58475851
},
58485852
{
58495853
"tcId": 519,
5850-
"comment": "cofactor = 0",
5854+
"comment": "no cofactor",
58515855
"flags": [
5852-
"NegativeCofactor",
5856+
"NoCofactor",
58535857
"InvalidPublic",
58545858
"UnnamedCurve"
58555859
],
@@ -5886,9 +5890,9 @@
58865890
},
58875891
{
58885892
"tcId": 522,
5889-
"comment": "cofactor = None",
5893+
"comment": "no cofactor",
58905894
"flags": [
5891-
"ModifiedCofactor",
5895+
"NoCofactor",
58925896
"UnusedParam",
58935897
"UnnamedCurve"
58945898
],

testvectors_v1/ecdh_brainpoolP384r1_test.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@
122122
"bugType": "MODIFIED_PARAMETER",
123123
"description": "The order of the public key has been modified.",
124124
"effect": "If this order is used in a cryptographic primitive instead of the correct order then an invalid curve attack is possible and the private keys may leak. E.g. ECDHC in BC 1.52 suffered from this."
125+
},
126+
"NoCofactor": {
127+
"bugType": "MISSING_PARAMETER",
128+
"description": "The cofactor field is absent from the ECParameters. RFC 3279 Section 2.3.5 requires the cofactor to be present."
125129
}
126130
},
127131
"testGroups": [
@@ -7523,9 +7527,9 @@
75237527
},
75247528
{
75257529
"tcId": 671,
7526-
"comment": "cofactor = 0",
7530+
"comment": "no cofactor",
75277531
"flags": [
7528-
"NegativeCofactor",
7532+
"NoCofactor",
75297533
"InvalidPublic",
75307534
"UnnamedCurve"
75317535
],
@@ -7562,9 +7566,9 @@
75627566
},
75637567
{
75647568
"tcId": 674,
7565-
"comment": "cofactor = None",
7569+
"comment": "no cofactor",
75667570
"flags": [
7567-
"ModifiedCofactor",
7571+
"NoCofactor",
75687572
"UnusedParam",
75697573
"UnnamedCurve"
75707574
],

testvectors_v1/ecdh_brainpoolP512r1_test.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@
122122
"bugType": "MODIFIED_PARAMETER",
123123
"description": "The order of the public key has been modified.",
124124
"effect": "If this order is used in a cryptographic primitive instead of the correct order then an invalid curve attack is possible and the private keys may leak. E.g. ECDHC in BC 1.52 suffered from this."
125+
},
126+
"NoCofactor": {
127+
"bugType": "MISSING_PARAMETER",
128+
"description": "The cofactor field is absent from the ECParameters. RFC 3279 Section 2.3.5 requires the cofactor to be present."
125129
}
126130
},
127131
"testGroups": [
@@ -6159,9 +6163,9 @@
61596163
},
61606164
{
61616165
"tcId": 547,
6162-
"comment": "cofactor = 0",
6166+
"comment": "no cofactor",
61636167
"flags": [
6164-
"NegativeCofactor",
6168+
"NoCofactor",
61656169
"InvalidPublic",
61666170
"UnnamedCurve"
61676171
],
@@ -6198,9 +6202,9 @@
61986202
},
61996203
{
62006204
"tcId": 550,
6201-
"comment": "cofactor = None",
6205+
"comment": "no cofactor",
62026206
"flags": [
6203-
"ModifiedCofactor",
6207+
"NoCofactor",
62046208
"UnusedParam",
62056209
"UnnamedCurve"
62066210
],

testvectors_v1/ecdh_secp224r1_pem_test.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@
116116
"bugType": "MODIFIED_PARAMETER",
117117
"description": "The order of the public key has been modified.",
118118
"effect": "If this order is used in a cryptographic primitive instead of the correct order then an invalid curve attack is possible and the private keys may leak. E.g. ECDHC in BC 1.52 suffered from this."
119+
},
120+
"NoCofactor": {
121+
"bugType": "MISSING_PARAMETER",
122+
"description": "The cofactor field is absent from the ECParameters. RFC 3279 Section 2.3.5 requires the cofactor to be present."
119123
}
120124
},
121125
"testGroups": [
@@ -5273,9 +5277,9 @@
52735277
},
52745278
{
52755279
"tcId": 467,
5276-
"comment": "cofactor = 0",
5280+
"comment": "no cofactor",
52775281
"flags": [
5278-
"NegativeCofactor",
5282+
"NoCofactor",
52795283
"InvalidPublic",
52805284
"UnnamedCurve"
52815285
],
@@ -5312,9 +5316,9 @@
53125316
},
53135317
{
53145318
"tcId": 470,
5315-
"comment": "cofactor = None",
5319+
"comment": "no cofactor",
53165320
"flags": [
5317-
"ModifiedCofactor",
5321+
"NoCofactor",
53185322
"UnusedParam",
53195323
"UnnamedCurve"
53205324
],

testvectors_v1/ecdh_secp224r1_test.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@
118118
"bugType": "MODIFIED_PARAMETER",
119119
"description": "The order of the public key has been modified.",
120120
"effect": "If this order is used in a cryptographic primitive instead of the correct order then an invalid curve attack is possible and the private keys may leak. E.g. ECDHC in BC 1.52 suffered from this."
121+
},
122+
"NoCofactor": {
123+
"bugType": "MISSING_PARAMETER",
124+
"description": "The cofactor field is absent from the ECParameters. RFC 3279 Section 2.3.5 requires the cofactor to be present."
121125
}
122126
},
123127
"testGroups": [
@@ -5275,9 +5279,9 @@
52755279
},
52765280
{
52775281
"tcId": 467,
5278-
"comment": "cofactor = 0",
5282+
"comment": "no cofactor",
52795283
"flags": [
5280-
"NegativeCofactor",
5284+
"NoCofactor",
52815285
"InvalidPublic",
52825286
"UnnamedCurve"
52835287
],
@@ -5314,9 +5318,9 @@
53145318
},
53155319
{
53165320
"tcId": 470,
5317-
"comment": "cofactor = None",
5321+
"comment": "no cofactor",
53185322
"flags": [
5319-
"ModifiedCofactor",
5323+
"NoCofactor",
53205324
"UnusedParam",
53215325
"UnnamedCurve"
53225326
],

testvectors_v1/ecdh_secp256k1_test.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@
118118
"bugType": "MODIFIED_PARAMETER",
119119
"description": "The order of the public key has been modified.",
120120
"effect": "If this order is used in a cryptographic primitive instead of the correct order then an invalid curve attack is possible and the private keys may leak. E.g. ECDHC in BC 1.52 suffered from this."
121+
},
122+
"NoCofactor": {
123+
"bugType": "MISSING_PARAMETER",
124+
"description": "The cofactor field is absent from the ECParameters. RFC 3279 Section 2.3.5 requires the cofactor to be present."
121125
}
122126
},
123127
"testGroups": [
@@ -5671,9 +5675,9 @@
56715675
},
56725676
{
56735677
"tcId": 503,
5674-
"comment": "cofactor = 0",
5678+
"comment": "no cofactor",
56755679
"flags": [
5676-
"NegativeCofactor",
5680+
"NoCofactor",
56775681
"InvalidPublic",
56785682
"UnnamedCurve"
56795683
],
@@ -5710,9 +5714,9 @@
57105714
},
57115715
{
57125716
"tcId": 506,
5713-
"comment": "cofactor = None",
5717+
"comment": "no cofactor",
57145718
"flags": [
5715-
"ModifiedCofactor",
5719+
"NoCofactor",
57165720
"UnusedParam",
57175721
"UnnamedCurve"
57185722
],

testvectors_v1/ecdh_secp256r1_pem_test.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@
124124
"bugType": "MODIFIED_PARAMETER",
125125
"description": "The order of the public key has been modified.",
126126
"effect": "If this order is used in a cryptographic primitive instead of the correct order then an invalid curve attack is possible and the private keys may leak. E.g. ECDHC in BC 1.52 suffered from this."
127+
},
128+
"NoCofactor": {
129+
"bugType": "MISSING_PARAMETER",
130+
"description": "The cofactor field is absent from the ECParameters. RFC 3279 Section 2.3.5 requires the cofactor to be present."
127131
}
128132
},
129133
"testGroups": [
@@ -4093,9 +4097,9 @@
40934097
},
40944098
{
40954099
"tcId": 359,
4096-
"comment": "cofactor = 0",
4100+
"comment": "no cofactor",
40974101
"flags": [
4098-
"NegativeCofactor",
4102+
"NoCofactor",
40994103
"InvalidPublic",
41004104
"UnnamedCurve"
41014105
],
@@ -4132,9 +4136,9 @@
41324136
},
41334137
{
41344138
"tcId": 362,
4135-
"comment": "cofactor = None",
4139+
"comment": "no cofactor",
41364140
"flags": [
4137-
"ModifiedCofactor",
4141+
"NoCofactor",
41384142
"UnusedParam",
41394143
"UnnamedCurve"
41404144
],

testvectors_v1/ecdh_secp256r1_test.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@
126126
"bugType": "MODIFIED_PARAMETER",
127127
"description": "The order of the public key has been modified.",
128128
"effect": "If this order is used in a cryptographic primitive instead of the correct order then an invalid curve attack is possible and the private keys may leak. E.g. ECDHC in BC 1.52 suffered from this."
129+
},
130+
"NoCofactor": {
131+
"bugType": "MISSING_PARAMETER",
132+
"description": "The cofactor field is absent from the ECParameters. RFC 3279 Section 2.3.5 requires the cofactor to be present."
129133
}
130134
},
131135
"testGroups": [
@@ -4095,9 +4099,9 @@
40954099
},
40964100
{
40974101
"tcId": 359,
4098-
"comment": "cofactor = 0",
4102+
"comment": "no cofactor",
40994103
"flags": [
4100-
"NegativeCofactor",
4104+
"NoCofactor",
41014105
"InvalidPublic",
41024106
"UnnamedCurve"
41034107
],
@@ -4134,9 +4138,9 @@
41344138
},
41354139
{
41364140
"tcId": 362,
4137-
"comment": "cofactor = None",
4141+
"comment": "no cofactor",
41384142
"flags": [
4139-
"ModifiedCofactor",
4143+
"NoCofactor",
41404144
"UnusedParam",
41414145
"UnnamedCurve"
41424146
],

0 commit comments

Comments
 (0)