Update the NetStandard test for overvotes.
This commit is contained in:
Родитель
1e635a09c4
Коммит
8aeee4091f
|
@ -73,7 +73,7 @@ namespace ElectionGuard.Encrypt.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Test_Encrypt_Ballot_Overvote_Fails()
|
public void Test_Encrypt_Ballot_Overvote_Succeeds()
|
||||||
{
|
{
|
||||||
// Configure the election context
|
// Configure the election context
|
||||||
var keypair = ElGamalKeyPair.FromSecret(Constants.TWO_MOD_Q);
|
var keypair = ElGamalKeyPair.FromSecret(Constants.TWO_MOD_Q);
|
||||||
|
@ -88,7 +88,7 @@ namespace ElectionGuard.Encrypt.Tests
|
||||||
var ballot = BallotGenerator.GetFakeBallot(internalManifest, 2);
|
var ballot = BallotGenerator.GetFakeBallot(internalManifest, 2);
|
||||||
var ciphertext = mediator.Encrypt(ballot);
|
var ciphertext = mediator.Encrypt(ballot);
|
||||||
|
|
||||||
Assert.That(ciphertext != null);
|
Assert.That(ciphertext.IsValidEncryption(context.ManifestHash, keypair.PublicKey, context.CryptoExtendedBaseHash));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -1070,6 +1070,8 @@ namespace electionguard
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log::debug("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
|
||||||
|
|
||||||
// Check the proofs on the ballot
|
// Check the proofs on the ballot
|
||||||
unordered_map<string, bool> validProofs;
|
unordered_map<string, bool> validProofs;
|
||||||
for (const auto &contest : this->getContests()) {
|
for (const auto &contest : this->getContests()) {
|
||||||
|
|
|
@ -988,6 +988,8 @@ bool eg_ciphertext_ballot_is_valid_encryption(eg_ciphertext_ballot_t *handle,
|
||||||
eg_element_mod_q_t *in_crypto_extended_base_hash)
|
eg_element_mod_q_t *in_crypto_extended_base_hash)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
Log::debug("TTTTTTTTTTTTTTTTTTTTTTTTT");
|
||||||
|
|
||||||
auto *ciphertext = AS_TYPE(CiphertextBallot, handle);
|
auto *ciphertext = AS_TYPE(CiphertextBallot, handle);
|
||||||
auto *encryptionSeed = AS_TYPE(ElementModQ, in_encryption_seed);
|
auto *encryptionSeed = AS_TYPE(ElementModQ, in_encryption_seed);
|
||||||
auto *public_key = AS_TYPE(ElementModP, in_public_key);
|
auto *public_key = AS_TYPE(ElementModP, in_public_key);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче