Skip to content

Commit

Permalink
RFC9830.hash_to_field() is mod n, not mod q.
Browse files Browse the repository at this point in the history
Regenerate test data.
  • Loading branch information
JohnLCaron committed May 23, 2024
1 parent 28992ab commit 73626d9
Show file tree
Hide file tree
Showing 485 changed files with 73,946 additions and 73,772 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class RFC9380(val group: EcGroupContext, val DST: ByteArray, kBytes: Int) {
//Steps:
val uniform_bytes = expand_message(msg)
val bi = BigInteger(1, uniform_bytes) // OS2IP equiv
return EcElementModQ(group, bi.mod(group.vecGroup.primeModulus)) // note that p == q for P-256
return EcElementModQ(group, bi.mod(group.vecGroup.order))
}

// expand_message_xmd(msg, DST, len_in_bytes)
Expand Down
58 changes: 29 additions & 29 deletions src/test/data/encrypt/testBallotChain/election_initialized.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"joint_public_key": "AvTfcvOKoNHlHz1GU48IjwKfYhuLGN3B74ewPir2SA5s",
"extended_base_hash": "+6hSNYbeU8WfJrb+Gyf61lulRHqtdOniIfwUqKTPuNc=",
"joint_public_key": "AtbNIz9IGwKWu92Er3oj1R4VAxArlGTsPHrpr3oa/Rdi",
"extended_base_hash": "pLm25Y9UBGqTm7EcYG/O8DrtMYlOWgbAy4pftHHqv5c=",
"guardians": [
{
"guardian_id": "guardian1",
"x_coordinate": 1,
"coefficient_proofs": [
{
"public_key": "A4eMashhI98O02pU+6e2CqKUyyZCYo6zPmQiGFhNaNB4",
"challenge": "D+H0hhcB4SQD/vVjIUPyybAUTqH4U1X5E5IwZdFRfFY=",
"response": "QqE88/4ir0jmL5s4tke0iiBwuheJHFaAvEZ0SSV4Qc8="
"public_key": "AyyxMiJpt8I5Tu4F1pblJkltg/2PhIq8GdS75pdyOw8k",
"challenge": "N3O2IDi04ZlxZBlY8TVWJDPa+QvKsn5oey4t4i74OeQ=",
"response": "v77cUuV7S++P9MmILIwxgMjYuN0RfV0p8F80SvRQ2Y8="
},
{
"public_key": "ArS2BS4g+HpWlWCl+6/NXy20Z6Xx93A3ASSgo4Dr5GTM",
"challenge": "wMbDd0LayRE5AH4nO7G5vGNrOwdKsiuWCJc2DQpwbhI=",
"response": "07R9ziYohrsTv4lM+2S38nrntnsl3n+8OG/L3CuXY0I="
"public_key": "A+z693r7pSvFBrVz7JPr8Kfwd6QfrWx+SnVQRk1C++l0",
"challenge": "XXMsLZn6AuFlHxK3YDPN2ORHAPqkNVfa8W4MOkBNdmM=",
"response": "v68Os+784ByRRW0Oua8fs/gPKyuwwHeAbrM3M2ToONA="
},
{
"public_key": "ArwfSVXyiu4v6j5lwxJLzr1pqgkRqF9IuAGLjT3hs2Nl",
"challenge": "P5+sGxVOxvDKVAnpn/EgSfz76rusQW96OrkxsiZzTqY=",
"response": "cJGdGGS5PTQsdciIj11jZrbBnu09Xm++IjAq/y9mTcM="
"public_key": "A5P7VqJc1L/P2PlRAagQQGa5zNDt7IvWHG02ETSHA0+7",
"challenge": "ONHZw1hgekQ6aQ70tVjHw/nvsM0EJnofpx2a97U7eig=",
"response": "GbpVLg0ikH+5/ODl7Yem8WYmImdVJawpb8xa1uNnGnQ="
}
]
},
Expand All @@ -28,19 +28,19 @@
"x_coordinate": 2,
"coefficient_proofs": [
{
"public_key": "AvAe3k23lVllXiS8HhaL+JbBqVx9YLkelh+BPa3noGRN",
"challenge": "nlR14Q9Ez+JVpB7FsBI4vKJX1c5bDsScHnF98MKZFS0=",
"response": "EVVT/piF/Pr4ASAf9bsqURvN7eQi+6vUxf8P7jPABKM="
"public_key": "AtIzKPY53xfoidSDHbcNUBkFZPvtIrM7OWhBE7nanNM9",
"challenge": "MlmGubcq9l4IgawYASN7CaBePysCLhkPTqeWvB3ZS0Q=",
"response": "kdBQXZdozRbYbPhFLtituum2f0yOqCG65zT0DftQZBE="
},
{
"public_key": "AuMfuxsm4NvAUTaaSuvc3sHr366RkyuKYu/6ibuP5hT8",
"challenge": "wmVI+dK2+9qi6IAv8Ag/ginTLz3+47Jaeu7adWFUOj0=",
"response": "EpJorKGLfuoGXZ6Dxy6WEyrNf6+UK9Pw+a/X7wNuImg="
"public_key": "A97vZPwp4GgPE0p2s0A6GB4GE7Xn3TXezY0B75iLkvwf",
"challenge": "tSlptACt0aTKzLWhY/zPKxH5GU0hr/z/BXDf0Hr7HaU=",
"response": "8PcKJSDYDgTLQsmZT1LmWnz1xcZGF1L4xyBQ3tx8aKA="
},
{
"public_key": "Ak2Ye1Ye4VtheIujvt9/xAUSX4ClBfFdiTuZv8w5h0aw",
"challenge": "kSQkqyXp521b4j1l1loAgOa7Orow0SO9QFDtBlWdXAY=",
"response": "va7hnp7FJumzRW1lIspzqGLyPbNFnkKVdsTBTcFEUAc="
"public_key": "A44iI1RhHNR707HfXFoZKC/jxutKWbiJvJmGG61YyoJA",
"challenge": "htMnPe9Y8/AhKRKGWrbJ0b52eZ/Nak6wOmgZU6yWbj4=",
"response": "rcK/jPRBv1uVGF6q4c+bJPAwciOp3QeaaYCgCD4Vm9U="
}
]
},
Expand All @@ -49,19 +49,19 @@
"x_coordinate": 3,
"coefficient_proofs": [
{
"public_key": "A26bnpvY+GeBun8JPeq0kHqWVH3H1CjHrF8x6ZD8eTgJ",
"challenge": "ImVpy70iqKqnqX7NwtNZWOITBpulwsQPE5rK0bSEMlk=",
"response": "rw2qgYRKMM8BOZ1aCcOGfh7Vs6EHI6IJarfyD1N2wnY="
"public_key": "AmNlmeHgG/dZo+azlZFR4/zWkvmiaxFNgL8VGpfDVDx0",
"challenge": "gNVAiI/EkaCEfxuD2vEUzY95ghPc3yyqdEXrbd3tnr0=",
"response": "CxqavK268CzmWrc3dcOytWVre3YLpOLintxh+WUPi8A="
},
{
"public_key": "A/+XIjbwhbM3LmAkko7PGcztAk+NOUEHTlEvlyAullSw",
"challenge": "9v5mzECkBIHmWrhd0VXlLHadWMdMNHD3NfiwRzdXnM0=",
"response": "/ksOtpNln/5ihfcb7Ls4nYEOJhzOjA3nd9ykV6rVI6g="
"public_key": "AysMwJz5Fiz9lEXKw6RtnqRgIDncPXs9wjTj+ymk5ghn",
"challenge": "lWodTxa4NLhjOnHw4UGg8mCRHKoArE3viM99bpFpmFw=",
"response": "hvob4D7OwZFfxsa6R5E84E2rk2sk3YB8yg7PELXDgt0="
},
{
"public_key": "A+3CZMgSd0G7DWo67C5kZdJkoW4yF+wSA548Vjzb/lhK",
"challenge": "NYWxDcjMHPbJTJOg/6cU1Ov5RLhGi6kbncVy9FtDug8=",
"response": "orC43LOI92M4QaarpDbSb1nnkpudJFxX5DjnP/PjmKQ="
"public_key": "AiMWArDu9heJwu4rHhXX2nFZcV1PRFqOgbrt32JA7FoV",
"challenge": "zx/zE9WGr69nsPPl9ylhumFoBVatS6NJFtSmUxUwDSw=",
"response": "4v40qRIfpkEMOaR5F04a8UF+iEVQE01wjHn5LHR4xic="
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
101,
49
],
"election_base_hash": "+6hSNYbeU8WfJrb+Gyf61lulRHqtdOniIfwUqKTPuNc=",
"election_base_hash": "pLm25Y9UBGqTm7EcYG/O8DrtMYlOWgbAy4pftHHqv5c=",
"ballot_ids": [
"id-423309862",
"id-557487366",
"id906976252",
"id1418213687",
"id-1570105887",
"id-976307237",
"id-404841242",
"id536728461",
"id-215603966",
"id802232992",
"id522733467",
"id690333833"
"id2022713283",
"id-193733846",
"id-1065313432",
"id-1232162799",
"id-1576398995",
"id1176997123",
"id-981568720",
"id-1102120102",
"id-814585975",
"id-368813857",
"id1278250060",
"id-1985659240"
],
"last_confirmation_code": "nGDhES44rLbH1dPo53MlSAR3c3lruOoCOI2sIow6Zh8=",
"closing_hash": "lt20Y7sSCYojMuyK+O1pyeDbOS/GqTvFrhhNcYNuwGg="
"last_confirmation_code": "bf3WpflnW/Z/gpGCXU0l5iNKgovR0iXfJFO+oquk+5c=",
"closing_hash": "we+vK8YwKXd67TUxUQyfAXOBZUIILdN0358JGEtcr5E="
}
Loading

0 comments on commit 73626d9

Please sign in to comment.