You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by sa...@apache.org on 2020/03/16 14:29:52 UTC

[incubator-milagro-MPC] branch issue18-add-python-flow-example updated (0a180eb -> 722e0c8)

This is an automated email from the ASF dual-hosted git repository.

sandreoli pushed a change to branch issue18-add-python-flow-example
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-MPC.git.


    from 0a180eb  do not copy .so files to python dir
     add f599311  add static code analysis
     add 83cccc4  change org for sonar
     add 73efc2c  update README
     add 1d4de99  Merge pull request #23 from apache/issue21
     add 4b8bfe4  Fix bug when using amcl compiled with DEBUG_NORM
     add b86c22f  Merge pull request #27 from apache/issue25-debug-norm
     add 8f053cc  Update AMCL and apply trick to MTA ZKP
     add 41517a3  Merge pull request #31 from apache/issue29-update-amcl
     add fda5ba5  Add custom functions for keys and k generation
     add fd1e161  Fix doxygen
     add 695f2e8  Wrap custom functions for keys and k generation. Lint code
     add 053d300  Add full flow using python wrappers
     add fd0b5eb  do not copy .so files to python dir
     add a3e13ad  Add AES wrappers and fix tests
     add 7bad751  Add RSA wrappers
     add 8b9da1d  Fix code smells
     add 8133fdc  Merge pull request #30 from apache/add-amcl-wrappers
     new 576b86e  Merge branch 'develop' into issue18-add-python-flow-example
     new 722e0c8  Fix paillier sk dump

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .travis.yml                                        |  31 +-
 Dockerfile                                         |  14 -
 README.md                                          |  24 +-
 cmake/PythonParameters.cmake                       |  45 +++
 include/amcl/commitments.h                         |   4 +-
 include/amcl/mpc.h                                 |  25 +-
 include/amcl/mta.h                                 |   8 +-
 include/amcl/schnorr.h                             |  12 +-
 python/CMakeLists.txt                              |   7 +
 python/amcl/CMakeLists.txt                         |   9 +-
 python/amcl/aes.py                                 | 144 +++++++++
 python/amcl/commitments.py                         |   4 +-
 python/amcl/mpc.py                                 |  12 +-
 python/amcl/rsa.py.in                              | 323 +++++++++++++++++++++
 python/amcl/schnorr.py                             |   6 +-
 python/benchmark/CMakeLists.txt                    |   5 +
 .../benchmark/{bench_nm_commit.py => bench_aes.py} |  34 ++-
 python/benchmark/bench_rsa.py.in                   |  67 +++++
 python/examples/CMakeLists.txt                     |   5 +
 .../{example_nm_commit.py => example_aes.py}       |  48 ++-
 .../{example_nm_commit.py => example_rsa.py.in}    |  34 ++-
 python/test/CMakeLists.txt                         |  12 +
 python/test/test_aes.py                            |  97 +++++++
 python/test/test_nm_commit.py                      |  10 +-
 python/test/test_rsa.py.in                         | 143 +++++++++
 python/test/test_schnorr.py                        |   1 -
 python/test/test_zk_factoring.py                   |  10 +-
 sonar-project.properties                           |  24 ++
 src/commitments.c                                  |  16 +-
 src/factoring_zk.c                                 |   4 +-
 src/mpc.c                                          |  70 ++---
 src/mta.c                                          |  75 +++--
 src/schnorr.c                                      |  14 +-
 test/smoke/test_bc_setup_smoke.c                   |   4 +-
 test/unit/test_mta_rp_challenge.c                  |   6 +-
 test/unit/test_mta_zk_challenge.c                  |   6 +-
 test/unit/test_mta_zkwc_challenge.c                |   6 +-
 testVectors/gcm/decrypt.json                       | 122 ++++++++
 testVectors/gcm/encrypt.json                       | 122 ++++++++
 testVectors/mta/mta_challenge.json                 |  20 +-
 testVectors/mta/mta_challenge.txt                  |  20 +-
 testVectors/mta/mtawc_challenge.json               |  20 +-
 testVectors/mta/mtawc_challenge.txt                |  20 +-
 testVectors/mta/rp_challenge.json                  |  20 +-
 testVectors/mta/rp_challenge.txt                   |  20 +-
 45 files changed, 1455 insertions(+), 268 deletions(-)
 create mode 100644 cmake/PythonParameters.cmake
 create mode 100644 python/amcl/aes.py
 create mode 100644 python/amcl/rsa.py.in
 copy python/benchmark/{bench_nm_commit.py => bench_aes.py} (52%)
 create mode 100755 python/benchmark/bench_rsa.py.in
 copy python/examples/{example_nm_commit.py => example_aes.py} (50%)
 copy python/examples/{example_nm_commit.py => example_rsa.py.in} (58%)
 create mode 100755 python/test/test_aes.py
 create mode 100755 python/test/test_rsa.py.in
 create mode 100644 sonar-project.properties
 create mode 100644 testVectors/gcm/decrypt.json
 create mode 100644 testVectors/gcm/encrypt.json


[incubator-milagro-MPC] 02/02: Fix paillier sk dump

Posted by sa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sandreoli pushed a commit to branch issue18-add-python-flow-example
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-MPC.git

commit 722e0c8d6e34a1e02c945e5cb5604690491a3af0
Author: Samuele Andreoli <sa...@yahoo.it>
AuthorDate: Mon Mar 16 14:29:27 2020 +0000

    Fix paillier sk dump
---
 python/amcl/mpc.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/python/amcl/mpc.py b/python/amcl/mpc.py
index 016d1c3..4714442 100644
--- a/python/amcl/mpc.py
+++ b/python/amcl/mpc.py
@@ -729,7 +729,5 @@ def mpc_dump_paillier_sk(paillier_sk):
     # Clear memory
     core_utils.clear_octet(p)
     core_utils.clear_octet(q)
-    core_utils.clear_octet(p2)
-    core_utils.clear_octet(q2)
 
     return p2, q2


[incubator-milagro-MPC] 01/02: Merge branch 'develop' into issue18-add-python-flow-example

Posted by sa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sandreoli pushed a commit to branch issue18-add-python-flow-example
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-MPC.git

commit 576b86e5a9d132e96d420a095159e12d167e88df
Merge: 0a180eb 8133fdc
Author: Samuele Andreoli <sa...@yahoo.it>
AuthorDate: Mon Mar 16 14:23:53 2020 +0000

    Merge branch 'develop' into issue18-add-python-flow-example
    
    Conflicts:
    	python/amcl/mpc.py
    	src/mpc.c

 .travis.yml                          |  31 +++-
 Dockerfile                           |  14 --
 README.md                            |  24 ++-
 cmake/PythonParameters.cmake         |  45 +++++
 include/amcl/commitments.h           |   4 +-
 include/amcl/mpc.h                   |  25 ++-
 include/amcl/mta.h                   |   8 +-
 include/amcl/schnorr.h               |  12 +-
 python/CMakeLists.txt                |   7 +
 python/amcl/CMakeLists.txt           |   9 +-
 python/amcl/aes.py                   | 144 ++++++++++++++++
 python/amcl/commitments.py           |   4 +-
 python/amcl/mpc.py                   |  10 +-
 python/amcl/rsa.py.in                | 323 +++++++++++++++++++++++++++++++++++
 python/amcl/schnorr.py               |   6 +-
 python/benchmark/CMakeLists.txt      |   5 +
 python/benchmark/bench_aes.py        |  51 ++++++
 python/benchmark/bench_rsa.py.in     |  67 ++++++++
 python/examples/CMakeLists.txt       |   5 +
 python/examples/example_aes.py       |  52 ++++++
 python/examples/example_rsa.py.in    |  56 ++++++
 python/test/CMakeLists.txt           |  12 ++
 python/test/test_aes.py              |  97 +++++++++++
 python/test/test_nm_commit.py        |  10 +-
 python/test/test_rsa.py.in           | 143 ++++++++++++++++
 python/test/test_schnorr.py          |   1 -
 python/test/test_zk_factoring.py     |  10 +-
 sonar-project.properties             |  24 +++
 src/commitments.c                    |  16 +-
 src/factoring_zk.c                   |   4 +-
 src/mpc.c                            |  70 ++++----
 src/mta.c                            |  75 +++++---
 src/schnorr.c                        |  14 +-
 test/smoke/test_bc_setup_smoke.c     |   4 +-
 test/unit/test_mta_rp_challenge.c    |   6 +-
 test/unit/test_mta_zk_challenge.c    |   6 +-
 test/unit/test_mta_zkwc_challenge.c  |   6 +-
 testVectors/gcm/decrypt.json         | 122 +++++++++++++
 testVectors/gcm/encrypt.json         | 122 +++++++++++++
 testVectors/mta/mta_challenge.json   |  20 +--
 testVectors/mta/mta_challenge.txt    |  20 +--
 testVectors/mta/mtawc_challenge.json |  20 +--
 testVectors/mta/mtawc_challenge.txt  |  20 +--
 testVectors/mta/rp_challenge.json    |  20 +--
 testVectors/mta/rp_challenge.txt     |  20 +--
 45 files changed, 1554 insertions(+), 210 deletions(-)

diff --cc include/amcl/mpc.h
index 7203578,2e7132c..2b3be46
--- a/include/amcl/mpc.h
+++ b/include/amcl/mpc.h
@@@ -79,17 -79,17 +79,26 @@@ int MPC_ECDSA_SIGN(int sha, const octe
   *  @param  S                S component of signature
   *  @return                  Returns 0 or else error code
   */
- int MPC_ECDSA_VERIFY(octet *HM,octet *PK, octet *R,octet *S);
+ int MPC_ECDSA_VERIFY(const octet *HM,octet *PK, octet *R,octet *S);
+ 
+ /** \brief Generate a random K for and ECDSA signature
+  *
+  *  Generate a random K modulo the curve order
+  *
+  *  @param RNG               Pointer to a cryptographically secure PRNG
+  *  @param K                 Destination octet for the randomly generated value
+  */
+ void MPC_K_GENERATE(csprng *RNG, octet *K);
  
 +/** \brief Generate a random K for and ECDSA signature
 + *
 + *  Generate a random K modulo the curve order
 + *
 + *  @param RNG               Pointer to a cryptographically secure PRNG
 + *  @param K                 Destination octet for the randomly generated value
 + */
 +void MPC_K_GENERATE(csprng *RNG, octet *K);
 +
  /** \brief Calculate the inverse of the sum of kgamma values
   *
   *  Calculate the inverse of the sum of kgamma values
diff --cc python/amcl/mpc.py
index c0f5ec7,7030202..016d1c3
--- a/python/amcl/mpc.py
+++ b/python/amcl/mpc.py
@@@ -75,7 -75,7 +75,7 @@@ extern void PAILLIER_PK_fromOctet(PAILL
  extern int ECP_SECP256K1_PUBLIC_KEY_VALIDATE(octet *W);
  
  extern void MPC_ECDSA_KEY_PAIR_GENERATE(csprng *RNG, octet *S, octet *W);
- extern int MPC_ECDSA_VERIFY(octet *HM,octet *PK, octet *R,octet *S);
 -extern int MPC_ECDSA_VERIFY(const octet *HM,octet *PK, octet *R,octet *S);
++extern int MPC_ECDSA_VERIFY(const octet *HM, octet *PK, octet *R, octet *S);
  extern void MPC_MTA_CLIENT1(csprng *RNG, PAILLIER_public_key* PUB, octet* A, octet* CA, octet* R);
  extern void MPC_MTA_CLIENT2(PAILLIER_private_key *PRIV, octet* CB, octet *ALPHA);
  extern void MPC_MTA_SERVER(csprng *RNG, PAILLIER_public_key *PUB, octet *B, octet *CA, octet *Z, octet *R, octet *CB, octet *BETA);
diff --cc src/mpc.c
index 6a97c46,1c3a6d7..d1014ad
--- a/src/mpc.c
+++ b/src/mpc.c
@@@ -26,8 -26,9 +26,8 @@@ under the License
  /* Generate ECDSA key pair */
  void MPC_ECDSA_KEY_PAIR_GENERATE(csprng *RNG, octet* S, octet *W)
  {
--
-     BIG_256_56 s, q;
+     BIG_256_56 s;
+     BIG_256_56 q;
  
      ECP_SECP256K1 G;