mirror of
https://github.com/tlsnotary/ole-protocols.git
synced 2026-01-08 22:18:07 -05:00
Created repo and started implementing protocol
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/target
|
||||
710
Cargo.lock
generated
Normal file
710
Cargo.lock
generated
Normal file
@@ -0,0 +1,710 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aes"
|
||||
version = "0.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cipher",
|
||||
"cpufeatures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ahash"
|
||||
version = "0.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"once_cell",
|
||||
"version_check",
|
||||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ark-ec"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba"
|
||||
dependencies = [
|
||||
"ark-ff",
|
||||
"ark-poly",
|
||||
"ark-serialize",
|
||||
"ark-std",
|
||||
"derivative",
|
||||
"hashbrown",
|
||||
"itertools",
|
||||
"num-traits",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ark-ff"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba"
|
||||
dependencies = [
|
||||
"ark-ff-asm",
|
||||
"ark-ff-macros",
|
||||
"ark-serialize",
|
||||
"ark-std",
|
||||
"derivative",
|
||||
"digest",
|
||||
"itertools",
|
||||
"num-bigint",
|
||||
"num-traits",
|
||||
"paste",
|
||||
"rustc_version",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ark-ff-asm"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ark-ff-macros"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565"
|
||||
dependencies = [
|
||||
"num-bigint",
|
||||
"num-traits",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ark-poly"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf"
|
||||
dependencies = [
|
||||
"ark-ff",
|
||||
"ark-serialize",
|
||||
"ark-std",
|
||||
"derivative",
|
||||
"hashbrown",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ark-secp256r1"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3975a01b0a6e3eae0f72ec7ca8598a6620fc72fa5981f6f5cca33b7cd788f633"
|
||||
dependencies = [
|
||||
"ark-ec",
|
||||
"ark-ff",
|
||||
"ark-std",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ark-serialize"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5"
|
||||
dependencies = [
|
||||
"ark-serialize-derive",
|
||||
"ark-std",
|
||||
"digest",
|
||||
"num-bigint",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ark-serialize-derive"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ark-std"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
"rand",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arrayref"
|
||||
version = "0.3.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||
|
||||
[[package]]
|
||||
name = "bcs"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85b6598a2f5d564fb7855dc6b06fd1c38cff5a72bd8b863a4d021938497b440a"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "blake3"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87"
|
||||
dependencies = [
|
||||
"arrayref",
|
||||
"arrayvec",
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"constant_time_eq",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bytemuck"
|
||||
version = "1.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6"
|
||||
dependencies = [
|
||||
"bytemuck_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bytemuck_derive"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.83"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "cipher"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
|
||||
dependencies = [
|
||||
"crypto-common",
|
||||
"inout",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clmul"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/privacy-scaling-explorations/mpz#33ac765766624e3f73d9bed8546f0b77d04b2d89"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "constant_time_eq"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2"
|
||||
|
||||
[[package]]
|
||||
name = "cpufeatures"
|
||||
version = "0.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-deque"
|
||||
version = "0.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crossbeam-epoch",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.9.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"cfg-if",
|
||||
"crossbeam-utils",
|
||||
"memoffset",
|
||||
"scopeguard",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derivative"
|
||||
version = "2.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
dependencies = [
|
||||
"crypto-common",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "e2f"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"mpz-share-conversion-core",
|
||||
"rand",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
|
||||
|
||||
[[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.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"wasi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "inout"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.10.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itybity"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f242558c18a6d4ec99bc1eaf1603ab49e857ab36b4c1b911ebd0028cb8165e79"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.150"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
|
||||
|
||||
[[package]]
|
||||
name = "memoffset"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mpz-core"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/privacy-scaling-explorations/mpz#33ac765766624e3f73d9bed8546f0b77d04b2d89"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"bcs",
|
||||
"blake3",
|
||||
"bytemuck",
|
||||
"cfg-if",
|
||||
"cipher",
|
||||
"clmul",
|
||||
"generic-array",
|
||||
"itybity",
|
||||
"once_cell",
|
||||
"opaque-debug",
|
||||
"rand",
|
||||
"rand_chacha",
|
||||
"rand_core",
|
||||
"rayon",
|
||||
"serde",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mpz-share-conversion-core"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/privacy-scaling-explorations/mpz#33ac765766624e3f73d9bed8546f0b77d04b2d89"
|
||||
dependencies = [
|
||||
"ark-ff",
|
||||
"ark-secp256r1",
|
||||
"ark-serialize",
|
||||
"itybity",
|
||||
"mpz-core",
|
||||
"num-bigint",
|
||||
"opaque-debug",
|
||||
"rand",
|
||||
"serde",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-bigint"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.45"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||
|
||||
[[package]]
|
||||
name = "opaque-debug"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
||||
|
||||
[[package]]
|
||||
name = "paste"
|
||||
version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
|
||||
|
||||
[[package]]
|
||||
name = "ppv-lite86"
|
||||
version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.70"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.33"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rand_chacha",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_chacha"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
|
||||
dependencies = [
|
||||
"ppv-lite86",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rayon"
|
||||
version = "1.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1"
|
||||
dependencies = [
|
||||
"either",
|
||||
"rayon-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rayon-core"
|
||||
version = "1.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed"
|
||||
dependencies = [
|
||||
"crossbeam-deque",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc_version"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
||||
dependencies = [
|
||||
"semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.193"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.193"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.109"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.39"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.50"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.50"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typenum"
|
||||
version = "1.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.11.0+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.7.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5d075cf85bbb114e933343e087b92f2146bac0d55b534cbb8188becf0039948e"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.7.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "86cd5ca076997b97ef09d3ad65efe811fa68c9e874cb636ccb211223a813b0c2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zeroize"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d"
|
||||
dependencies = [
|
||||
"zeroize_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zeroize_derive"
|
||||
version = "1.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
12
Cargo.toml
Normal file
12
Cargo.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "e2f"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
mpz-share-conversion-core = { git = "https://github.com/privacy-scaling-explorations/mpz" }
|
||||
rand = "0.8"
|
||||
|
||||
|
||||
62
src/lib.rs
Normal file
62
src/lib.rs
Normal file
@@ -0,0 +1,62 @@
|
||||
//! This crate is a testing ground for the E2F protocol (page 33) from <https://eprint.iacr.org/2023/964>
|
||||
|
||||
use mpz_share_conversion_core::fields::{p256::P256, UniformRand};
|
||||
use rand::thread_rng;
|
||||
|
||||
mod prover;
|
||||
mod verifier;
|
||||
|
||||
pub use prover::Prover;
|
||||
pub use verifier::Verifier;
|
||||
|
||||
pub struct Ole {
|
||||
input_sender: Vec<P256>,
|
||||
input_receiver: Vec<P256>,
|
||||
output: Vec<P256>,
|
||||
}
|
||||
|
||||
impl Ole {
|
||||
pub fn input(&mut self, role: Role, input: Vec<P256>) {
|
||||
if role == Role::Sender {
|
||||
self.input_sender = input;
|
||||
} else {
|
||||
self.input_receiver = input;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn output(&mut self, role: Role) -> Vec<P256> {
|
||||
assert!(self.input_sender.len() == self.input_receiver.len());
|
||||
|
||||
if !self.output.is_empty() {
|
||||
return std::mem::take(&mut self.output);
|
||||
}
|
||||
|
||||
let mut rng = thread_rng();
|
||||
let mut output = vec![];
|
||||
let mut output_cached = vec![];
|
||||
|
||||
for (s, r) in self.input_sender.iter().zip(self.input_receiver.iter()) {
|
||||
let s_out = P256::rand(&mut rng);
|
||||
let r_out = *s * *r + -s_out;
|
||||
|
||||
if role == Role::Sender {
|
||||
output.push(s_out);
|
||||
output_cached.push(r_out);
|
||||
} else {
|
||||
output.push(r_out);
|
||||
output_cached.push(s_out);
|
||||
}
|
||||
}
|
||||
self.input_sender.clear();
|
||||
self.input_receiver.clear();
|
||||
|
||||
self.output = output_cached;
|
||||
output
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum Role {
|
||||
Sender,
|
||||
Receiver,
|
||||
}
|
||||
97
src/prover.rs
Normal file
97
src/prover.rs
Normal file
@@ -0,0 +1,97 @@
|
||||
//! The prover implementation
|
||||
|
||||
use crate::{Ole, Role};
|
||||
use mpz_share_conversion_core::fields::{p256::P256, UniformRand};
|
||||
use rand::thread_rng;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Prover {
|
||||
// Preprocess 1
|
||||
a1: Option<P256>,
|
||||
b1: Option<P256>,
|
||||
b1_prime: Option<P256>,
|
||||
r1: Option<P256>,
|
||||
|
||||
// Preprocess 2
|
||||
a1_b2_share: Option<P256>,
|
||||
a2_b1_share: Option<P256>,
|
||||
a1_b2_prime_share: Option<P256>,
|
||||
a2_b1_prime_share: Option<P256>,
|
||||
r1_r2_share: Option<P256>,
|
||||
|
||||
// Preprocess 3
|
||||
c1: Option<P256>,
|
||||
c1_prime: Option<P256>,
|
||||
|
||||
// Preprocess 4
|
||||
r_squared_share: Option<P256>,
|
||||
|
||||
// Handshake 5
|
||||
ec_point: Option<(P256, P256)>,
|
||||
omega_share: Option<P256>,
|
||||
}
|
||||
|
||||
impl Prover {
|
||||
pub fn preprocess1(&mut self) {
|
||||
let mut rng = thread_rng();
|
||||
|
||||
self.a1 = Some(P256::rand(&mut rng));
|
||||
self.b1 = Some(P256::rand(&mut rng));
|
||||
self.b1_prime = Some(P256::rand(&mut rng));
|
||||
self.r1 = Some(P256::rand(&mut rng));
|
||||
}
|
||||
|
||||
pub fn preprocess2_ole_input(&mut self, ole: &mut Ole) {
|
||||
let a1 = self.a1.unwrap();
|
||||
let b1 = self.b1.unwrap();
|
||||
let b1_prime = self.b1_prime.unwrap();
|
||||
let r1 = self.r1.unwrap();
|
||||
|
||||
ole.input(Role::Sender, vec![a1, b1, a1, b1_prime, r1]);
|
||||
}
|
||||
|
||||
pub fn preprocess2_ole_output(&mut self, ole: &mut Ole) {
|
||||
let output = ole.output(Role::Sender);
|
||||
|
||||
self.a1_b2_share = Some(output[0]);
|
||||
self.a2_b1_share = Some(output[1]);
|
||||
self.a1_b2_prime_share = Some(output[2]);
|
||||
self.a2_b1_prime_share = Some(output[3]);
|
||||
self.r1_r2_share = Some(output[4]);
|
||||
}
|
||||
|
||||
pub fn preprocess3(&mut self) {
|
||||
let a1_b1_share = self.a1.unwrap() * self.b1.unwrap();
|
||||
let a1_b2_share = self.a1_b2_share.unwrap();
|
||||
let a2_b1_share = self.a2_b1_share.unwrap();
|
||||
|
||||
self.c1 = Some(a1_b1_share + a1_b2_share + a2_b1_share);
|
||||
|
||||
let a1_b1_prime_share = self.a1.unwrap() * self.b1_prime.unwrap();
|
||||
let a1_b2_prime_share = self.a1_b2_prime_share.unwrap();
|
||||
let a2_b1_prime_share = self.a2_b1_prime_share.unwrap();
|
||||
|
||||
self.c1_prime = Some(a1_b1_prime_share + a1_b2_prime_share + a2_b1_prime_share);
|
||||
}
|
||||
|
||||
pub fn preproces4(&mut self) {
|
||||
let r1_squared = self.r1.unwrap() * self.r1.unwrap();
|
||||
|
||||
let two = P256::new(2).unwrap();
|
||||
let r1_r2_share = self.r1_r2_share.unwrap();
|
||||
|
||||
self.r_squared_share = Some(r1_squared + two * r1_r2_share);
|
||||
}
|
||||
|
||||
pub fn handshake5_input_ec(&mut self, ec_point: (P256, P256)) {
|
||||
self.ec_point = Some(ec_point);
|
||||
}
|
||||
|
||||
pub fn handshake5_varepsilon1_share_open(&self) -> P256 {
|
||||
-self.ec_point.unwrap().0 + -self.b1.unwrap()
|
||||
}
|
||||
|
||||
pub fn handshake5_set_omega(&mut self, varepsilon1: P256) {
|
||||
self.omega_share = Some(varepsilon1 * self.a1.unwrap() + self.c1.unwrap());
|
||||
}
|
||||
}
|
||||
97
src/verifier.rs
Normal file
97
src/verifier.rs
Normal file
@@ -0,0 +1,97 @@
|
||||
//! The verifier implementation
|
||||
|
||||
use crate::{Ole, Role};
|
||||
use mpz_share_conversion_core::fields::{p256::P256, UniformRand};
|
||||
use rand::thread_rng;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Verifier {
|
||||
// Preprocess 1
|
||||
a2: Option<P256>,
|
||||
b2: Option<P256>,
|
||||
b2_prime: Option<P256>,
|
||||
r2: Option<P256>,
|
||||
|
||||
// Preprocess 2
|
||||
a1_b2_share: Option<P256>,
|
||||
a2_b1_share: Option<P256>,
|
||||
a1_b2_prime_share: Option<P256>,
|
||||
a2_b1_prime_share: Option<P256>,
|
||||
r1_r2_share: Option<P256>,
|
||||
|
||||
// Preprocess 3
|
||||
c2: Option<P256>,
|
||||
c2_prime: Option<P256>,
|
||||
|
||||
// Preprocess 4
|
||||
r_squared_share: Option<P256>,
|
||||
|
||||
// Handshake 5
|
||||
ec_point: Option<(P256, P256)>,
|
||||
omega_share: Option<P256>,
|
||||
}
|
||||
|
||||
impl Verifier {
|
||||
pub fn preprocess1(&mut self) {
|
||||
let mut rng = thread_rng();
|
||||
|
||||
self.a2 = Some(P256::rand(&mut rng));
|
||||
self.b2 = Some(P256::rand(&mut rng));
|
||||
self.b2_prime = Some(P256::rand(&mut rng));
|
||||
self.r2 = Some(P256::rand(&mut rng));
|
||||
}
|
||||
|
||||
pub fn preprocess2_ole_input(&mut self, ole: &mut Ole) {
|
||||
let a2 = self.a2.unwrap();
|
||||
let b2 = self.b2.unwrap();
|
||||
let b2_prime = self.b2_prime.unwrap();
|
||||
let r2 = self.r2.unwrap();
|
||||
|
||||
ole.input(Role::Receiver, vec![b2, a2, b2_prime, a2, r2]);
|
||||
}
|
||||
|
||||
pub fn preprocess2_ole_output(&mut self, ole: &mut Ole) {
|
||||
let output = ole.output(Role::Receiver);
|
||||
|
||||
self.a1_b2_share = Some(output[0]);
|
||||
self.a2_b1_share = Some(output[1]);
|
||||
self.a1_b2_prime_share = Some(output[2]);
|
||||
self.a2_b1_prime_share = Some(output[3]);
|
||||
self.r1_r2_share = Some(output[4]);
|
||||
}
|
||||
|
||||
pub fn preprocess3(&mut self) {
|
||||
let a2_b2_share = self.a2.unwrap() * self.b2.unwrap();
|
||||
let a1_b2_share = self.a1_b2_share.unwrap();
|
||||
let a2_b1_share = self.a2_b1_share.unwrap();
|
||||
|
||||
self.c2 = Some(a2_b2_share + a1_b2_share + a2_b1_share);
|
||||
|
||||
let a2_b2_prime_share = self.a2.unwrap() * self.b2_prime.unwrap();
|
||||
let a1_b2_prime_share = self.a1_b2_prime_share.unwrap();
|
||||
let a2_b1_prime_share = self.a2_b1_prime_share.unwrap();
|
||||
|
||||
self.c2_prime = Some(a2_b2_prime_share + a1_b2_prime_share + a2_b1_prime_share);
|
||||
}
|
||||
|
||||
pub fn preprocess4(&mut self) {
|
||||
let r2_squared = self.r2.unwrap() * self.r2.unwrap();
|
||||
|
||||
let two = P256::new(2).unwrap();
|
||||
let r1_r2_share = self.r1_r2_share.unwrap();
|
||||
|
||||
self.r_squared_share = Some(r2_squared + two * r1_r2_share);
|
||||
}
|
||||
|
||||
pub fn handshake5_input_ec(&mut self, ec_point: (P256, P256)) {
|
||||
self.ec_point = Some(ec_point);
|
||||
}
|
||||
|
||||
pub fn handshake5_varepsilon1_share_open(&self) -> P256 {
|
||||
self.ec_point.unwrap().0 + -self.b2.unwrap()
|
||||
}
|
||||
|
||||
pub fn handshake5_set_omega(&mut self, varepsilon1: P256) {
|
||||
self.omega_share = Some(varepsilon1 * self.a2.unwrap() + self.c2.unwrap());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user