aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_tss.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-01-07 11:03:55 +0000
committerlloyd <[email protected]>2014-01-07 11:03:55 +0000
commitc109c7f84fcef6ba895c6293508b2deae0e803c1 (patch)
tree35ba7b55914023a77ecfbcf5dee2befcc4e275d1 /src/tests/test_tss.cpp
parenta7e3abf95fd1bc3df45be6fc9cb82e28e0a727ea (diff)
Rename test sources
Diffstat (limited to 'src/tests/test_tss.cpp')
-rw-r--r--src/tests/test_tss.cpp61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/tests/test_tss.cpp b/src/tests/test_tss.cpp
deleted file mode 100644
index f9caddb6f..000000000
--- a/src/tests/test_tss.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-* (C) 2009 Jack Lloyd
-*
-* Distributed under the terms of the Botan license
-*/
-
-#include "tests.h"
-#include <botan/auto_rng.h>
-#include <botan/hex.h>
-#include <botan/tss.h>
-#include <iostream>
-#include <stdio.h>
-
-namespace {
-
-void print(const Botan::secure_vector<Botan::byte>& r)
- {
- for(Botan::u32bit i = 0; i != r.size(); ++i)
- printf("%02X", r[i]);
- printf("\n");
- }
-
-}
-
-size_t test_tss()
- {
- using namespace Botan;
-
- AutoSeeded_RNG rng;
-
- size_t fails = 0;
-
- byte id[16];
- for(int i = 0; i != 16; ++i)
- id[i] = i;
-
- const secure_vector<byte> S = hex_decode_locked("7465737400");
-
- std::vector<RTSS_Share> shares =
- RTSS_Share::split(2, 4, &S[0], S.size(), id, rng);
-
- auto back = RTSS_Share::reconstruct(shares);
-
- if(S != back)
- {
- std::cout << "TSS-0: " << hex_encode(S) << " != " << hex_encode(back) << "\n";
- ++fails;
- }
-
- shares.resize(shares.size()-1);
-
- back = RTSS_Share::reconstruct(shares);
-
- if(S != back)
- {
- std::cout << "TSS-1: " << hex_encode(S) << " != " << hex_encode(back) << "\n";
- ++fails;
- }
-
- return fails;
- }