mirror of
https://github.com/saymrwulf/swisspost-evoting-go-poc.git
synced 2026-09-04 20:23:55 +00:00
Correctness/security review of the whole PoC, with fixes and regression tests.
Cryptographic soundness:
- mixnet: enforce the multi-exponentiation c_{B_m}=commit(0;0) check that was
stubbed out with an empty if — without it a malicious mixer can prove a
non-permutation shuffle.
- zkp: derive all four Fiat-Shamir challenges via RecursiveHashToZq instead of
a biased `hash mod q` (which also capped the challenge space at 256 bits for
production-sized groups).
Verification honesty:
- protocol: VerifyTally now actually calls zkp.VerifySchnorrProof and returns
the true aggregate result instead of an unconditional true.
- protocol: persist the padded mix input (event.MixInput) so the verifier checks
shuffle 0 against the same padding the tally used (fixes false INVALID for N<2).
Other correctness:
- kdf: length-prefix BuildKDFInfo parts so the info encoding is injective.
- math: GqElementFromSquareRoot accepts the valid root q (off-by-one that could
panic in HashAndSquare); RandomGqElement samples the full canonical range.
- cmd: validate demo --voters/--options instead of panicking on degenerate values.
- protocol: use crypto/rand in the demo driver (drop the last math/rand import).
Transport security (new): pkg/transportsec exposes Ed25519 signatures and X25519
ECDH — implemented in Rust (rust/transportsec: ed25519-dalek, x25519-dalek),
linked into Go via cgo. No RSA. Cross-language conformance test proves the Rust
Ed25519 signatures interoperate with Go's crypto/ed25519. Makefile builds the
Rust static lib before the Go binary.
Tests: added unit/round-trip/tamper coverage for math, hash, elgamal, zkp,
mixnet, kdf, returncodes, protocol (end-to-end), and the Rust FFI bridge.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
348 lines
8.5 KiB
TOML
348 lines
8.5 KiB
TOML
# This file is automatically @generated by Cargo.
|
|
# It is not intended for manual editing.
|
|
version = 4
|
|
|
|
[[package]]
|
|
name = "base64ct"
|
|
version = "1.8.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
|
|
|
|
[[package]]
|
|
name = "block-buffer"
|
|
version = "0.10.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
|
dependencies = [
|
|
"generic-array",
|
|
]
|
|
|
|
[[package]]
|
|
name = "cfg-if"
|
|
version = "1.0.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
|
|
[[package]]
|
|
name = "const-oid"
|
|
version = "0.9.6"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
|
|
|
|
[[package]]
|
|
name = "cpufeatures"
|
|
version = "0.2.17"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
|
|
dependencies = [
|
|
"libc",
|
|
]
|
|
|
|
[[package]]
|
|
name = "crypto-common"
|
|
version = "0.1.7"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
|
|
dependencies = [
|
|
"generic-array",
|
|
"typenum",
|
|
]
|
|
|
|
[[package]]
|
|
name = "curve25519-dalek"
|
|
version = "4.1.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
|
|
dependencies = [
|
|
"cfg-if",
|
|
"cpufeatures",
|
|
"curve25519-dalek-derive",
|
|
"digest",
|
|
"fiat-crypto",
|
|
"rustc_version",
|
|
"subtle",
|
|
"zeroize",
|
|
]
|
|
|
|
[[package]]
|
|
name = "curve25519-dalek-derive"
|
|
version = "0.1.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
"quote",
|
|
"syn",
|
|
]
|
|
|
|
[[package]]
|
|
name = "der"
|
|
version = "0.7.10"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
|
|
dependencies = [
|
|
"const-oid",
|
|
"zeroize",
|
|
]
|
|
|
|
[[package]]
|
|
name = "digest"
|
|
version = "0.10.7"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
|
dependencies = [
|
|
"block-buffer",
|
|
"crypto-common",
|
|
]
|
|
|
|
[[package]]
|
|
name = "ed25519"
|
|
version = "2.2.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
|
|
dependencies = [
|
|
"pkcs8",
|
|
"signature",
|
|
]
|
|
|
|
[[package]]
|
|
name = "ed25519-dalek"
|
|
version = "2.2.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9"
|
|
dependencies = [
|
|
"curve25519-dalek",
|
|
"ed25519",
|
|
"rand_core",
|
|
"serde",
|
|
"sha2",
|
|
"subtle",
|
|
"zeroize",
|
|
]
|
|
|
|
[[package]]
|
|
name = "fiat-crypto"
|
|
version = "0.2.9"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
|
|
|
|
[[package]]
|
|
name = "generic-array"
|
|
version = "0.14.7"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
|
dependencies = [
|
|
"typenum",
|
|
"version_check",
|
|
]
|
|
|
|
[[package]]
|
|
name = "getrandom"
|
|
version = "0.2.17"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
|
|
dependencies = [
|
|
"cfg-if",
|
|
"libc",
|
|
"wasi",
|
|
]
|
|
|
|
[[package]]
|
|
name = "libc"
|
|
version = "0.2.186"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
|
|
|
[[package]]
|
|
name = "pkcs8"
|
|
version = "0.10.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
|
|
dependencies = [
|
|
"der",
|
|
"spki",
|
|
]
|
|
|
|
[[package]]
|
|
name = "proc-macro2"
|
|
version = "1.0.106"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
dependencies = [
|
|
"unicode-ident",
|
|
]
|
|
|
|
[[package]]
|
|
name = "quote"
|
|
version = "1.0.46"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
]
|
|
|
|
[[package]]
|
|
name = "rand_core"
|
|
version = "0.6.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
|
dependencies = [
|
|
"getrandom",
|
|
]
|
|
|
|
[[package]]
|
|
name = "rustc_version"
|
|
version = "0.4.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
|
|
dependencies = [
|
|
"semver",
|
|
]
|
|
|
|
[[package]]
|
|
name = "semver"
|
|
version = "1.0.28"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
|
|
|
|
[[package]]
|
|
name = "serde"
|
|
version = "1.0.228"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
dependencies = [
|
|
"serde_core",
|
|
"serde_derive",
|
|
]
|
|
|
|
[[package]]
|
|
name = "serde_core"
|
|
version = "1.0.228"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
dependencies = [
|
|
"serde_derive",
|
|
]
|
|
|
|
[[package]]
|
|
name = "serde_derive"
|
|
version = "1.0.228"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
"quote",
|
|
"syn",
|
|
]
|
|
|
|
[[package]]
|
|
name = "sha2"
|
|
version = "0.10.9"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
|
dependencies = [
|
|
"cfg-if",
|
|
"cpufeatures",
|
|
"digest",
|
|
]
|
|
|
|
[[package]]
|
|
name = "signature"
|
|
version = "2.2.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
|
|
dependencies = [
|
|
"rand_core",
|
|
]
|
|
|
|
[[package]]
|
|
name = "spki"
|
|
version = "0.7.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
|
|
dependencies = [
|
|
"base64ct",
|
|
"der",
|
|
]
|
|
|
|
[[package]]
|
|
name = "subtle"
|
|
version = "2.6.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
|
|
|
[[package]]
|
|
name = "syn"
|
|
version = "2.0.118"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
"quote",
|
|
"unicode-ident",
|
|
]
|
|
|
|
[[package]]
|
|
name = "transportsec"
|
|
version = "0.1.0"
|
|
dependencies = [
|
|
"ed25519-dalek",
|
|
"rand_core",
|
|
"x25519-dalek",
|
|
]
|
|
|
|
[[package]]
|
|
name = "typenum"
|
|
version = "1.20.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
|
|
|
|
[[package]]
|
|
name = "unicode-ident"
|
|
version = "1.0.24"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
|
|
[[package]]
|
|
name = "version_check"
|
|
version = "0.9.5"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
|
|
|
[[package]]
|
|
name = "wasi"
|
|
version = "0.11.1+wasi-snapshot-preview1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
|
|
|
|
[[package]]
|
|
name = "x25519-dalek"
|
|
version = "2.0.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277"
|
|
dependencies = [
|
|
"curve25519-dalek",
|
|
"rand_core",
|
|
"serde",
|
|
"zeroize",
|
|
]
|
|
|
|
[[package]]
|
|
name = "zeroize"
|
|
version = "1.9.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e"
|
|
dependencies = [
|
|
"zeroize_derive",
|
|
]
|
|
|
|
[[package]]
|
|
name = "zeroize_derive"
|
|
version = "1.5.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
"quote",
|
|
"syn",
|
|
]
|