GCryptLib: Fix include paths
This commit is contained in:
parent
9432325b4a
commit
7fe9dcc6dc
@ -1,8 +1,8 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <GhettoCryptWrapper.h>
|
#include <GCrypt/GhettoCryptWrapper.h>
|
||||||
#include <SecureBitset.h>
|
#include <GCrypt/SecureBitset.h>
|
||||||
#include <Util.h>
|
#include <GCrypt/Util.h>
|
||||||
#include <InitializationVector.h>
|
#include <GCrypt/InitializationVector.h>
|
||||||
|
|
||||||
using namespace Leonetienne::GCrypt;
|
using namespace Leonetienne::GCrypt;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "SecureBitset.h"
|
#include "GCrypt/SecureBitset.h"
|
||||||
#include "Config.h"
|
#include "GCrypt/Config.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
typedef SecureBitset<BLOCK_SIZE> Block;
|
typedef SecureBitset<BLOCK_SIZE> Block;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Feistel.h"
|
#include "GCrypt/Feistel.h"
|
||||||
#include "Flexblock.h"
|
#include "GCrypt/Flexblock.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
/** Class to apply a block cipher to messages of arbitrary length in a distributed manner
|
/** Class to apply a block cipher to messages of arbitrary length in a distributed manner
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Keyset.h"
|
#include "GCrypt/Keyset.h"
|
||||||
#include "Block.h"
|
#include "GCrypt/Block.h"
|
||||||
#include "Halfblock.h"
|
#include "GCrypt/Halfblock.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
/** Class to perform a feistel block chipher
|
/** Class to perform a feistel block chipher
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "SecureBitset.h"
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include "Config.h"
|
#include "GCrypt/SecureBitset.h"
|
||||||
|
#include "GCrypt/Config.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
constexpr std::size_t HALFBLOCK_SIZE = (BLOCK_SIZE / 2);
|
constexpr std::size_t HALFBLOCK_SIZE = (BLOCK_SIZE / 2);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Config.h"
|
#include "GCrypt/Config.h"
|
||||||
#include "Block.h"
|
#include "GCrypt/Block.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
/** Will create a sudo-random Block based on a seed
|
/** Will create a sudo-random Block based on a seed
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <array>
|
#include <array>
|
||||||
#include "Block.h"
|
#include "GCrypt/Block.h"
|
||||||
#include "Config.h"
|
#include "GCrypt/Config.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
typedef std::array<Block, N_ROUNDS> Keyset;
|
typedef std::array<Block, N_ROUNDS> Keyset;
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "SecureBitset.h"
|
#include "GCrypt/SecureBitset.h"
|
||||||
#include "Block.h"
|
#include "GCrypt/Block.h"
|
||||||
#include "Flexblock.h"
|
#include "GCrypt/Flexblock.h"
|
||||||
#include "Config.h"
|
#include "GCrypt/Config.h"
|
||||||
#include "Cipher.h"
|
#include "GCrypt/Cipher.h"
|
||||||
#include "InitializationVector.h"
|
#include "GCrypt/InitializationVector.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
//! Mod-operator that works with negative values
|
//! Mod-operator that works with negative values
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "Cipher.h"
|
#include "GCrypt/Cipher.h"
|
||||||
#include "Util.h"
|
#include "GCrypt/Util.h"
|
||||||
#include "InitializationVector.h"
|
#include "GCrypt/InitializationVector.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include "Feistel.h"
|
#include "GCrypt/Feistel.h"
|
||||||
#include "Util.h"
|
#include "GCrypt/Util.h"
|
||||||
#include "Config.h"
|
#include "GCrypt/Config.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "GhettoCryptWrapper.h"
|
#include "GCrypt/GhettoCryptWrapper.h"
|
||||||
#include "Cipher.h"
|
#include "GCrypt/Cipher.h"
|
||||||
#include "Util.h"
|
#include "GCrypt/Util.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "InitializationVector.h"
|
#include "GCrypt/InitializationVector.h"
|
||||||
#include "Feistel.h"
|
#include "GCrypt/Feistel.h"
|
||||||
|
|
||||||
namespace Leonetienne::GCrypt {
|
namespace Leonetienne::GCrypt {
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/*
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
#include "../GhettoCrypt/Cipher.h"
|
#include "../GhettoCrypt/Cipher.h"
|
||||||
#include "../GhettoCrypt/Util.h"
|
#include "../GhettoCrypt/Util.h"
|
||||||
@ -228,3 +229,4 @@ namespace SimpleTests
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
@ -1,11 +1,32 @@
|
|||||||
#include "CppUnitTest.h"
|
#include <GCrypt/GhettoCryptWrapper.h>
|
||||||
#include "../GhettoCrypt/GhettoCryptWrapper.h"
|
#include <GCrypt/Flexblock.h>
|
||||||
#include "../GhettoCrypt/Flexblock.h"
|
#include <GCrypt/Util.h>
|
||||||
#include "../GhettoCrypt/Util.h"
|
#include "Catch2.h"
|
||||||
|
|
||||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
using namespace Leonetienne::GCrypt;
|
||||||
using namespace GhettoCipher;
|
|
||||||
|
|
||||||
|
// Tests that encrypting and decrypting strings using the wrapper works.
|
||||||
|
// This test will start from scratch after encryption, to ensure EVERYTHING has to be re-calculated.
|
||||||
|
TEST_CASE(__FILE__"/Encrypting and decrypting strings works", "[Wrapper]") {
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
const std::string plaintext = "Hello, World!";
|
||||||
|
const std::string password = "Der Affe will Zucker";
|
||||||
|
|
||||||
|
std::string ciphertext;
|
||||||
|
std::string decrypted;
|
||||||
|
|
||||||
|
// Encryption
|
||||||
|
ciphertext = GhettoCryptWrapper::EncryptString(plaintext, password);
|
||||||
|
|
||||||
|
// Decryption
|
||||||
|
decrypted = GhettoCryptWrapper::DecryptString(ciphertext, password);
|
||||||
|
|
||||||
|
// Assertion
|
||||||
|
REQUIRE(plaintext == decrypted);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
namespace SimpleTests
|
namespace SimpleTests
|
||||||
{
|
{
|
||||||
TEST_CLASS(GCWrapper)
|
TEST_CLASS(GCWrapper)
|
||||||
@ -79,3 +100,4 @@ namespace SimpleTests
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/*
|
||||||
#include "CppUnitTest.h"
|
#include "CppUnitTest.h"
|
||||||
#include "../GhettoCrypt/Util.h"
|
#include "../GhettoCrypt/Util.h"
|
||||||
#include "../GhettoCrypt/Config.h"
|
#include "../GhettoCrypt/Config.h"
|
||||||
@ -108,3 +109,4 @@ namespace SimpleTests
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
2
GCryptLib/test/main.cpp
Normal file
2
GCryptLib/test/main.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#define CATCH_CONFIG_MAIN
|
||||||
|
#include "Catch2.h"
|
Loading…
x
Reference in New Issue
Block a user