summaryrefslogtreecommitdiffstats
path: root/cryptopp562/basecode.h
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2024-10-24 06:44:24 -0400
committerMalfurious <m@lfurio.us>2024-10-24 06:44:24 -0400
commit512aa4c77b3dc0d72db713a9215ff65a98a99ec3 (patch)
tree6db82e0109dc987b5b021f81d4e8a0926eb75ff7 /cryptopp562/basecode.h
parent428471d39fb8c205a9fad899c88c30a2cb7df685 (diff)
parent10affea371406c0ae4c080e5a19390a8e9bd154b (diff)
downloadcompass-512aa4c77b3dc0d72db713a9215ff65a98a99ec3.tar.gz
compass-512aa4c77b3dc0d72db713a9215ff65a98a99ec3.zip
Merge branch 'mbedtls'
Replace Crypto++ 5.6.2 with Mbed TLS 3.6.0 Newer compilers are starting to show the age of the crypto library we've been using, as it is sometimes a pain to recompile compass lately. So, the tracked version of Crypto++ was at least due for an upgrade. However, I plan to soon begin reimplementing compass in C. So, I'm taking this opportunity to first just migrate the cryptography library to a newer C alternative. This branch does so, and integrates its use into the current C++ version of compass. * mbedtls: Remove unnecessary exception handler catch block Refactor random password generation to use mbedtls entropy source Refactor SHA256 function to use mbedtls Refactor AES functions to use mbedtls Add Mbedtls library Remove Crypto++ library
Diffstat (limited to 'cryptopp562/basecode.h')
-rw-r--r--cryptopp562/basecode.h86
1 files changed, 0 insertions, 86 deletions
diff --git a/cryptopp562/basecode.h b/cryptopp562/basecode.h
deleted file mode 100644
index cc44c43..0000000
--- a/cryptopp562/basecode.h
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef CRYPTOPP_BASECODE_H
-#define CRYPTOPP_BASECODE_H
-
-#include "filters.h"
-#include "algparam.h"
-#include "argnames.h"
-
-NAMESPACE_BEGIN(CryptoPP)
-
-//! base n encoder, where n is a power of 2
-class CRYPTOPP_DLL BaseN_Encoder : public Unflushable<Filter>
-{
-public:
- BaseN_Encoder(BufferedTransformation *attachment=NULL)
- {Detach(attachment);}
-
- BaseN_Encoder(const byte *alphabet, int log2base, BufferedTransformation *attachment=NULL, int padding=-1)
- {
- Detach(attachment);
- IsolatedInitialize(MakeParameters(Name::EncodingLookupArray(), alphabet)
- (Name::Log2Base(), log2base)
- (Name::Pad(), padding != -1)
- (Name::PaddingByte(), byte(padding)));
- }
-
- void IsolatedInitialize(const NameValuePairs &parameters);
- size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking);
-
-private:
- const byte *m_alphabet;
- int m_padding, m_bitsPerChar, m_outputBlockSize;
- int m_bytePos, m_bitPos;
- SecByteBlock m_outBuf;
-};
-
-//! base n decoder, where n is a power of 2
-class CRYPTOPP_DLL BaseN_Decoder : public Unflushable<Filter>
-{
-public:
- BaseN_Decoder(BufferedTransformation *attachment=NULL)
- {Detach(attachment);}
-
- BaseN_Decoder(const int *lookup, int log2base, BufferedTransformation *attachment=NULL)
- {
- Detach(attachment);
- IsolatedInitialize(MakeParameters(Name::DecodingLookupArray(), lookup)(Name::Log2Base(), log2base));
- }
-
- void IsolatedInitialize(const NameValuePairs &parameters);
- size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking);
-
- static void CRYPTOPP_API InitializeDecodingLookupArray(int *lookup, const byte *alphabet, unsigned int base, bool caseInsensitive);
-
-private:
- const int *m_lookup;
- int m_padding, m_bitsPerChar, m_outputBlockSize;
- int m_bytePos, m_bitPos;
- SecByteBlock m_outBuf;
-};
-
-//! filter that breaks input stream into groups of fixed size
-class CRYPTOPP_DLL Grouper : public Bufferless<Filter>
-{
-public:
- Grouper(BufferedTransformation *attachment=NULL)
- {Detach(attachment);}
-
- Grouper(int groupSize, const std::string &separator, const std::string &terminator, BufferedTransformation *attachment=NULL)
- {
- Detach(attachment);
- IsolatedInitialize(MakeParameters(Name::GroupSize(), groupSize)
- (Name::Separator(), ConstByteArrayParameter(separator))
- (Name::Terminator(), ConstByteArrayParameter(terminator)));
- }
-
- void IsolatedInitialize(const NameValuePairs &parameters);
- size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking);
-
-private:
- SecByteBlock m_separator, m_terminator;
- size_t m_groupSize, m_counter;
-};
-
-NAMESPACE_END
-
-#endif