diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-01-26 20:00:37 -0500 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-01-26 20:00:37 -0500 |
| commit | f3dfd636343904a01681c80e91b44aa00ce33f2e (patch) | |
| tree | 12ab5514aaffaba0759bef88fa3b2c8a34bad565 /selftest.cpp | |
| parent | 5f5302e59535c988188e3857469c5414014d62c4 (diff) | |
| download | infinitytier-f3dfd636343904a01681c80e91b44aa00ce33f2e.tar.gz infinitytier-f3dfd636343904a01681c80e91b44aa00ce33f2e.zip | |
Clean up some old stuff.
Diffstat (limited to 'selftest.cpp')
| -rw-r--r-- | selftest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/selftest.cpp b/selftest.cpp index c3fd397c..cf3bbdeb 100644 --- a/selftest.cpp +++ b/selftest.cpp @@ -321,10 +321,10 @@ static int testCrypto() std::cout << "[crypto] Testing C25519 and Ed25519 against test vectors... "; std::cout.flush(); for(int k=0;k<ZT_NUM_C25519_TEST_VECTORS;++k) { C25519::Pair p1,p2; - memcpy(p1.pub.data,C25519_TEST_VECTORS[k].pub1,p1.pub.size()); - memcpy(p1.priv.data,C25519_TEST_VECTORS[k].priv1,p1.priv.size()); - memcpy(p2.pub.data,C25519_TEST_VECTORS[k].pub2,p2.pub.size()); - memcpy(p2.priv.data,C25519_TEST_VECTORS[k].priv2,p2.priv.size()); + memcpy(p1.pub.data,C25519_TEST_VECTORS[k].pub1,ZT_C25519_PUBLIC_KEY_LEN); + memcpy(p1.priv.data,C25519_TEST_VECTORS[k].priv1,ZT_C25519_PRIVATE_KEY_LEN); + memcpy(p2.pub.data,C25519_TEST_VECTORS[k].pub2,ZT_C25519_PUBLIC_KEY_LEN); + memcpy(p2.priv.data,C25519_TEST_VECTORS[k].priv2,ZT_C25519_PRIVATE_KEY_LEN); C25519::agree(p1,p2.pub,buf1,64); C25519::agree(p2,p1.pub,buf2,64); if (memcmp(buf1,buf2,64)) { @@ -410,7 +410,7 @@ static int testCrypto() } for(unsigned int k=0;k<64;++k) { C25519::Signature sig2(sig); - sig2.data[rand() % sig2.size()] ^= (unsigned char)(1 << (rand() & 7)); + sig2.data[rand() % ZT_C25519_SIGNATURE_LEN] ^= (unsigned char)(1 << (rand() & 7)); if (C25519::verify(p1.pub,buf1,sizeof(buf1),sig2)) { std::cout << "FAIL (5)" << std::endl; return -1; |
