Skip to content

Instantly share code, notes, and snippets.

@rhelmer
Created September 28, 2018 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhelmer/4739df8471c818b013f15eb74279146a to your computer and use it in GitHub Desktop.
Save rhelmer/4739df8471c818b013f15eb74279146a to your computer and use it in GitHub Desktop.
--- a/ptest/client_test.c 2018-09-28 02:06:50.207986209 +0000
+++ b/ptest/client_test.c 2018-09-28 02:07:12.445975672 +0000
@@ -9,10 +9,10 @@
#include <mprio.h>
#include "mutest.h"
-#include "test_util.h"
#include "prio/client.h"
#include "prio/server.h"
#include "prio/util.h"
+#include "test_util.h"
void
mu_test_client__new(void)
--- a/ptest/encrypt_test.c 2018-09-28 02:06:50.207986209 +0000
+++ b/ptest/encrypt_test.c 2018-09-28 02:07:12.455061233 +0000
@@ -14,10 +14,10 @@
#include <secoidt.h>
#include "mutest.h"
-#include "test_util.h"
#include "prio/encrypt.h"
#include "prio/rand.h"
#include "prio/util.h"
+#include "test_util.h"
void
mu_test_keygen(void)
@@ -64,7 +64,7 @@
PT_CHECKC(Keypair_new(&pvtkey, &pubkey));
PT_CHECKC(Keypair_new(&pvtkey2, &pubkey2));
PT_CHECKC(PublicKey_encrypt(pubkey, bytes_enc, &encryptedBytes, enclen,
- bytes_in, inlen));
+ bytes_in, inlen));
mu_check(encryptedBytes == enclen);
if (bad == 1)
@@ -220,8 +220,8 @@
memset(privData, 0, 5);
}
- PT_CHECKC(PrivateKey_import(&pvtkey_imp, privData, CURVE25519_KEY_LEN, pubData,
- CURVE25519_KEY_LEN));
+ PT_CHECKC(PrivateKey_import(&pvtkey_imp, privData, CURVE25519_KEY_LEN,
+ pubData, CURVE25519_KEY_LEN));
PT_CHECKC(PrivateKey_export(pvtkey_imp, privData2));
mu_check(!memcmp(privData, privData2, CURVE25519_KEY_LEN));
@@ -229,12 +229,12 @@
if (!zeros) {
unsigned int outputLen;
PT_CHECKC(PublicKey_encrypt(pubkey, output, &outputLen, sizeof(output),
- input, sizeof(input)));
+ input, sizeof(input)));
// Check that can decrypt with imported private key.
unsigned int plainLen;
- PT_CHECKC(PrivateKey_decrypt(pvtkey_imp, decrypt, &plainLen, sizeof(decrypt),
- output, outputLen));
+ PT_CHECKC(PrivateKey_decrypt(pvtkey_imp, decrypt, &plainLen,
+ sizeof(decrypt), output, outputLen));
mu_check(plainLen == sizeof(input));
mu_check(!memcmp(input, decrypt, sizeof(input)));
@@ -288,7 +288,7 @@
}
PT_CHECKC(PrivateKey_import_hex(&pvtkey_imp, privData, CURVE25519_KEY_LEN_HEX,
- pubData, CURVE25519_KEY_LEN_HEX));
+ pubData, CURVE25519_KEY_LEN_HEX));
PT_CHECKC(PrivateKey_export_hex(pvtkey_imp, privData2));
mu_check(!memcmp(privData, privData2, CURVE25519_KEY_LEN));
@@ -296,12 +296,12 @@
if (!zeros) {
unsigned int outputLen;
PT_CHECKC(PublicKey_encrypt(pubkey, output, &outputLen, sizeof(output),
- input, sizeof(input)));
+ input, sizeof(input)));
// Check that can decrypt with imported private key.
unsigned int plainLen;
- PT_CHECKC(PrivateKey_decrypt(pvtkey_imp, decrypt, &plainLen, sizeof(decrypt),
- output, outputLen));
+ PT_CHECKC(PrivateKey_decrypt(pvtkey_imp, decrypt, &plainLen,
+ sizeof(decrypt), output, outputLen));
mu_check(plainLen == sizeof(input));
mu_check(!memcmp(input, decrypt, sizeof(input)));
--- a/ptest/fft_test.c 2018-09-28 02:06:50.207986209 +0000
+++ b/ptest/fft_test.c 2018-09-28 02:07:12.467121204 +0000
@@ -11,11 +11,11 @@
#include <stdio.h>
#include "mutest.h"
-#include "test_util.h"
#include "prio/config.h"
#include "prio/mparray.h"
#include "prio/poly.h"
#include "prio/util.h"
+#include "test_util.h"
void
mu_test__fft_one(void)
--- a/ptest/prg_test.c 2018-09-28 02:06:50.207986209 +0000
+++ b/ptest/prg_test.c 2018-09-28 02:07:12.482169314 +0000
@@ -9,9 +9,9 @@
#include <mpi.h>
#include "mutest.h"
-#include "test_util.h"
#include "prio/prg.h"
#include "prio/util.h"
+#include "test_util.h"
void
mu_test__prg_simple(void)
@@ -340,7 +340,7 @@
for (int i = 0; i < 10; i++) {
MPT_CHECKC(mp_addmod(&arr->data[i], &arr_share->data[i], &cfg->modulus,
- &arr->data[i]));
+ &arr->data[i]));
mu_check(mp_cmp_d(&arr->data[i], i) == 0);
}
--- a/ptest/rand_test.c 2018-09-28 02:06:50.207986209 +0000
+++ b/ptest/rand_test.c 2018-09-28 02:07:12.486807290 +0000
@@ -9,10 +9,10 @@
#include <mpi.h>
#include "mutest.h"
-#include "test_util.h"
-#include "test_util.h"
#include "prio/rand.h"
#include "prio/util.h"
+#include "test_util.h"
+#include "test_util.h"
void
mu_test__util_msb_mast(void)
--- a/ptest/serial_test.c 2018-09-28 02:06:50.207986209 +0000
+++ b/ptest/serial_test.c 2018-09-28 02:07:12.497086827 +0000
@@ -11,12 +11,12 @@
#include <string.h>
#include "mutest.h"
-#include "test_util.h"
#include "prio/client.h"
#include "prio/config.h"
#include "prio/serial.h"
#include "prio/server.h"
#include "prio/util.h"
+#include "test_util.h"
SECStatus
gen_client_packets(const_PrioConfig cfg, PrioPacketClient pA,
--- a/ptest/server_test.c 2018-09-28 02:06:50.207986209 +0000
+++ b/ptest/server_test.c 2018-09-28 02:07:12.507152500 +0000
@@ -10,10 +10,10 @@
#include <mprio.h>
#include "mutest.h"
-#include "test_util.h"
#include "prio/client.h"
#include "prio/server.c"
#include "prio/server.h"
+#include "test_util.h"
void
mu_test__eval_poly(void)
@@ -76,7 +76,8 @@
PT_CHECKC(Keypair_new(&skA, &pkA));
PT_CHECKC(Keypair_new(&skB, &pkB));
- PT_CHECKA(cfg = PrioConfig_new(214, pkA, pkB, (unsigned char*)"testbatch", 9));
+ PT_CHECKA(cfg =
+ PrioConfig_new(214, pkA, pkB, (unsigned char*)"testbatch", 9));
const int ndata = PrioConfig_numDataFields(cfg);
PT_CHECKA(data_items = calloc(ndata, sizeof(bool)));
--- a/ptest/share_test.c 2018-09-28 02:06:50.207986209 +0000
+++ b/ptest/share_test.c 2018-09-28 02:07:12.517908043 +0000
@@ -10,12 +10,12 @@
#include <mprio.h>
#include "mutest.h"
-#include "test_util.h"
#include "prio/client.h"
#include "prio/config.h"
#include "prio/mparray.h"
#include "prio/share.h"
#include "prio/util.h"
+#include "test_util.h"
void
mu_test_share(void)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment