From e6e21d177d4f967249d5f9883d8ac024536b107b Mon Sep 17 00:00:00 2001 From: arnaucube Date: Mon, 3 Jun 2019 20:37:03 +0200 Subject: [PATCH] add travis --- .travis.yml | 8 ++++++++ README.md | 3 ++- paillier/paillier_test.go | 18 ++++++++++++++++-- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..715bb59 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: go + +go: + - "1.12" + +env: + - GO111MODULE=on + diff --git a/README.md b/README.md index c9fc804..18d67c0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# cryptofun [![Go Report Card](https://goreportcard.com/badge/github.com/arnaucube/cryptofun)](https://goreportcard.com/report/github.com/arnaucube/cryptofun) +# cryptofun [![Go Report Card](https://goreportcard.com/badge/github.com/arnaucube/cryptofun)](https://goreportcard.com/report/github.com/arnaucube/cryptofun) [![Build Status](https://travis-ci.org/arnaucube/cryptofun.svg?branch=master)](https://travis-ci.org/arnaucube/cryptofun) + Crypto algorithms from scratch. Academic purposes only. diff --git a/paillier/paillier_test.go b/paillier/paillier_test.go index 3a4598d..c7de28c 100644 --- a/paillier/paillier_test.go +++ b/paillier/paillier_test.go @@ -24,8 +24,22 @@ func TestEncryptDecrypt(t *testing.T) { } func TestHomomorphicAddition(t *testing.T) { - key, err := GenerateKeyPair() - assert.Nil(t, err) + // key, err := GenerateKeyPair() + // assert.Nil(t, err) + + // key harcoded for tests + pubK := PublicKey{ + N: big.NewInt(204223), + G: big.NewInt(24929195694), + } + privK := PrivateKey{ + Lambda: big.NewInt(101660), + Mu: big.NewInt(117648), + } + key := Key{ + PubK: pubK, + PrivK: privK, + } n1 := big.NewInt(int64(110)) n2 := big.NewInt(int64(150))