diff --git a/Project.toml b/Project.toml index 845c774..5fd8ad7 100644 --- a/Project.toml +++ b/Project.toml @@ -6,6 +6,7 @@ version = "0.3.2" [deps] CryptoGroups = "bc997328-bedd-407e-bcd3-5758e064a52d" CryptoPRG = "d846c407-34c1-46cb-aa27-d51818cc05e2" +CryptoUtils = "04afed74-ac16-11e9-37b6-1352e3e05830" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SigmaProofs = "f8559b4c-f045-44a2-8db2-503e40bb7416" @@ -15,6 +16,7 @@ SigmaProofs = {path = "SigmaProofs"} [compat] CryptoGroups = "0.5" CryptoPRG = "0.1" +CryptoUtils = "0.1.1" julia = "1" [extras] diff --git a/src/ShuffleProofs.jl b/src/ShuffleProofs.jl index 607e605..317ba16 100644 --- a/src/ShuffleProofs.jl +++ b/src/ShuffleProofs.jl @@ -6,6 +6,8 @@ function __init__() CryptoGroups.set_strict_mode(true) end +include("../SigmaProofs/src/SigmaProofs.jl") + include("utils.jl") # Common functions include("prover.jl") include("parser.jl") diff --git a/src/prover.jl b/src/prover.jl index 0f8901c..15f9586 100644 --- a/src/prover.jl +++ b/src/prover.jl @@ -1,6 +1,6 @@ using CryptoGroups.Utils: @check using CryptoGroups: Group, order, modulus -using SigmaProofs.ElGamal: Enc, Dec, ElGamalRow +using .SigmaProofs.ElGamal: Enc, Dec, ElGamalRow abstract type Proposition end abstract type Proof end diff --git a/src/verifier.jl b/src/verifier.jl index b1fb44a..58fed0d 100644 --- a/src/verifier.jl +++ b/src/verifier.jl @@ -1,4 +1,4 @@ -using SigmaProofs.GeneratorBasis: generator_basis +using .SigmaProofs.GeneratorBasis: generator_basis using CryptoPRG.Verificatum: HashSpec, PRG, RO, ROPRG using CryptoGroups: Group, PGroup, ECGroup diff --git a/test/braid.jl b/test/braid.jl index eb87e3b..26534b6 100644 --- a/test/braid.jl +++ b/test/braid.jl @@ -2,7 +2,7 @@ using Test import ShuffleProofs: prove, verify, decrypt, ProtocolSpec, shuffle, ShuffleProofs, braid, load import CryptoGroups: PGroup, CryptoGroups, @ECGroup -import SigmaProofs.ElGamal: Enc, Dec, ElGamalRow +import ShuffleProofs.SigmaProofs.ElGamal: Enc, Dec, ElGamalRow SPEC = "$(@__DIR__)/validation_sample/verificatum/MODP/protInfo.xml" verifier = load(ProtocolSpec, SPEC) diff --git a/test/proof.jl b/test/proof.jl index cb38cab..a23132c 100644 --- a/test/proof.jl +++ b/test/proof.jl @@ -1,7 +1,7 @@ using Test import CryptoGroups: @PGroup, @ECGroup -import SigmaProofs.ElGamal: ElGamalRow, Enc, Dec +import ShuffleProofs.SigmaProofs.ElGamal: ElGamalRow, Enc, Dec import CryptoGroups import ShuffleProofs: prove, verify, Simulator, gen_shuffle, Verifier, PoSChallenge, Shuffle, shuffle, VShuffleProof, PoSProof diff --git a/test/runtests.jl b/test/runtests.jl index 8e7198a..5010057 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,6 +3,10 @@ using SafeTestsets using CryptoGroups CryptoGroups.set_strict_mode(true) +# @safetestset "SigmaProofs tests" begin +# include("../test/runtests.jl") +# end + @safetestset "Number conversations" begin include("utils.jl") end diff --git a/test/verificatum-prover.jl b/test/verificatum-prover.jl index 825dd94..5f761ce 100644 --- a/test/verificatum-prover.jl +++ b/test/verificatum-prover.jl @@ -3,7 +3,7 @@ using Test import ShuffleProofs: prove, verify, Simulator, gen_shuffle, Verifier, PoSChallenge, Shuffle, shuffle, VShuffleProof, PoSProof, ProtocolSpec, gen_roprg, load import CryptoGroups: PGroup -import SigmaProofs.ElGamal: Enc, Dec, ElGamalRow +import ShuffleProofs.SigmaProofs.ElGamal: Enc, Dec, ElGamalRow SPEC = "$(@__DIR__)/validation_sample/verificatum/MODP/protInfo.xml" verifier = load(ProtocolSpec, SPEC) diff --git a/test/verificatum_schema/ciphertexts.jl b/test/verificatum_schema/ciphertexts.jl index 80c0475..6b9df7f 100644 --- a/test/verificatum_schema/ciphertexts.jl +++ b/test/verificatum_schema/ciphertexts.jl @@ -1,7 +1,7 @@ using Test import ShuffleProofs: decode, encode, Tree, unmarshal, marshal_publickey, unmarshal_publickey, unmarshal_privatekey import CryptoGroups: PGroup -import SigmaProofs.ElGamal: Dec, ElGamalRow +import ShuffleProofs.SigmaProofs.ElGamal: Dec, ElGamalRow CIPHERTEXT_FILE = "$(@__DIR__)/../validation_sample/verificatum/MODP/ciphertexts" diff --git a/test/verificatum_schema/ecparser.jl b/test/verificatum_schema/ecparser.jl index 6b3055a..3a97ba3 100644 --- a/test/verificatum_schema/ecparser.jl +++ b/test/verificatum_schema/ecparser.jl @@ -1,7 +1,7 @@ # Tesing internals for elliptic curve parsing with verificatum using Test -import SigmaProofs.ElGamal: ElGamalRow +import ShuffleProofs.SigmaProofs.ElGamal: ElGamalRow import ShuffleProofs: marshal_s_Gq, unmarshal, decode, marshal, unmarshal_publickey, marshal_publickey, marshal_privatekey, unmarshal_privatekey, load_verificatum_proposition, load_verificatum_proof, load_verificatum_simulator, ro_prefix, verify s_Gq = "com.verificatum.arithm.ECqPGroup(P-256)::00000000020100000020636f6d2e766572696669636174756d2e61726974686d2e4543715047726f75700100000005502d323536" diff --git a/test/verificatum_schema/proofparser.jl b/test/verificatum_schema/proofparser.jl index fdd2709..7ab97da 100644 --- a/test/verificatum_schema/proofparser.jl +++ b/test/verificatum_schema/proofparser.jl @@ -6,7 +6,7 @@ import ShuffleProofs: decode, convert, unmarshal_publickey, interpret, Tree, enc import CryptoGroups: PGroup, value, order, CryptoGroups#, bitlength #, outlen import CryptoPRG: HashSpec import CryptoPRG.Verificatum: RO, PRG -import SigmaProofs.ElGamal: ElGamalRow +import ShuffleProofs.SigmaProofs.ElGamal: ElGamalRow function ro_prefix(protinfo::AbstractDict; auxsid="default")