Skip to content

Commit

Permalink
ecdsa: add improved test coverage for recoverPubKey
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Jul 29, 2014
1 parent be3ce88 commit 5657dcf
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion test/fixtures/ecdsa.json
Expand Up @@ -73,16 +73,66 @@
],
"invalid": {
"recoverPubKey": [
{
"description": "Invalid r value (< 0)",
"exception": "Invalid r value",
"e": "01",
"signature": {
"r": "-01",
"s": "02"
},
"i": 0
},
{
"description": "Invalid r value (== 0)",
"exception": "nR is not a valid curve point",
"exception": "Invalid r value",
"e": "01",
"signature": {
"r": "00",
"s": "02"
},
"i": 0
},
{
"description": "Invalid s value (< 0)",
"exception": "Invalid s value",
"e": "01",
"signature": {
"r": "02",
"s": "-01"
},
"i": 0
},
{
"description": "Invalid s value (== 0)",
"exception": "Invalid s value",
"e": "01",
"signature": {
"r": "02",
"s": "00"
},
"i": 0
},
{
"description": "Invalid r value (nR is infinity)",
"exception": "nR is not a valid curve point",
"e": "01",
"signature": {
"r": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
"s": "01"
},
"i": 0
},
{
"description": "Invalid curve point",
"exception": "Point is not on the curve",
"e": "01",
"signature": {
"r": "99999999999999999999999999999999999999",
"s": "01"
},
"i": 0
},
{
"description": "Invalid i value (> 3)",
"exception": "Recovery param is more than two bits",
Expand Down

0 comments on commit 5657dcf

Please sign in to comment.