mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-04 06:16:20 +12:00
Remove cryptoppwin submodule (#754)
Some checks failed
Android Build / x64 (release) (push) Has been cancelled
Android Build / arm64 (release) (push) Has been cancelled
HTTP Server Build / build (push) Has been cancelled
Hydra Core Build / Windows (push) Has been cancelled
Hydra Core Build / MacOS (push) Has been cancelled
Hydra Core Build / Linux (push) Has been cancelled
Hydra Core Build / Android-x64 (push) Has been cancelled
Hydra Core Build / ARM-Libretro (push) Has been cancelled
Linux AppImage Build / build (push) Has been cancelled
Linux Build / build (push) Has been cancelled
MacOS Build / MacOS-arm64 (push) Has been cancelled
MacOS Build / MacOS-x86_64 (push) Has been cancelled
MacOS Build / MacOS-Universal (push) Has been cancelled
Qt Build / Windows (push) Has been cancelled
Qt Build / MacOS-arm64 (push) Has been cancelled
Qt Build / MacOS-x86_64 (push) Has been cancelled
Qt Build / MacOS-Universal (push) Has been cancelled
Qt Build / Linux (push) Has been cancelled
Windows Build / build (push) Has been cancelled
iOS Simulator Build / build (push) Has been cancelled
Some checks failed
Android Build / x64 (release) (push) Has been cancelled
Android Build / arm64 (release) (push) Has been cancelled
HTTP Server Build / build (push) Has been cancelled
Hydra Core Build / Windows (push) Has been cancelled
Hydra Core Build / MacOS (push) Has been cancelled
Hydra Core Build / Linux (push) Has been cancelled
Hydra Core Build / Android-x64 (push) Has been cancelled
Hydra Core Build / ARM-Libretro (push) Has been cancelled
Linux AppImage Build / build (push) Has been cancelled
Linux Build / build (push) Has been cancelled
MacOS Build / MacOS-arm64 (push) Has been cancelled
MacOS Build / MacOS-x86_64 (push) Has been cancelled
MacOS Build / MacOS-Universal (push) Has been cancelled
Qt Build / Windows (push) Has been cancelled
Qt Build / MacOS-arm64 (push) Has been cancelled
Qt Build / MacOS-x86_64 (push) Has been cancelled
Qt Build / MacOS-Universal (push) Has been cancelled
Qt Build / Linux (push) Has been cancelled
Windows Build / build (push) Has been cancelled
iOS Simulator Build / build (push) Has been cancelled
This commit is contained in:
parent
5591606177
commit
6182d4cfe9
198 changed files with 51291 additions and 4 deletions
206
third_party/cryptoppwin/include/cryptopp/simon.h
vendored
Normal file
206
third_party/cryptoppwin/include/cryptopp/simon.h
vendored
Normal file
|
@ -0,0 +1,206 @@
|
|||
// simon.h - written and placed in the public domain by Jeffrey Walton
|
||||
|
||||
/// \file simon.h
|
||||
/// \brief Classes for the Simon block cipher
|
||||
/// \details Simon is a block cipher designed by Ray Beaulieu, Douglas Shors, Jason Smith,
|
||||
/// Stefan Treatman-Clark, Bryan Weeks and Louis Wingers.
|
||||
/// \sa <A HREF="http://eprint.iacr.org/2013/404">The SIMON and SPECK Families of
|
||||
/// Lightweight Block Ciphers</A>, <A HREF="http://iadgov.github.io/simon-speck/">
|
||||
/// The Simon and Speck GitHub</A> and <A HREF="https://www.cryptopp.com/wiki/SIMON">
|
||||
/// SIMON</A> on the Crypto++ wiki.
|
||||
/// \since Crypto++ 6.0
|
||||
|
||||
#ifndef CRYPTOPP_SIMON_H
|
||||
#define CRYPTOPP_SIMON_H
|
||||
|
||||
#include "config.h"
|
||||
#include "seckey.h"
|
||||
#include "secblock.h"
|
||||
|
||||
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || \
|
||||
CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8 || \
|
||||
CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64
|
||||
# ifndef CRYPTOPP_DISABLE_SIMON_SIMD
|
||||
# define CRYPTOPP_SIMON128_ADVANCED_PROCESS_BLOCKS 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Yet another SunStudio/SunCC workaround. Failed self tests
|
||||
// in SSE code paths on i386 for SunStudio 12.3 and below.
|
||||
#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x5120)
|
||||
# undef CRYPTOPP_SIMON128_ADVANCED_PROCESS_BLOCKS
|
||||
#endif
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
/// \brief SIMON block cipher information
|
||||
/// \tparam L block size of the cipher, in bytes
|
||||
/// \tparam D default key length, in bytes
|
||||
/// \tparam N minimum key length, in bytes
|
||||
/// \tparam M maximum key length, in bytes
|
||||
/// \since Crypto++ 6.0
|
||||
template <unsigned int L, unsigned int D, unsigned int N, unsigned int M>
|
||||
struct SIMON_Info : public FixedBlockSize<L>, VariableKeyLength<D, N, M>
|
||||
{
|
||||
/// \brief The algorithm name
|
||||
/// \return the algorithm name
|
||||
/// \details StaticAlgorithmName returns the algorithm's name as a static
|
||||
/// member function.
|
||||
static const std::string StaticAlgorithmName()
|
||||
{
|
||||
// Format is Cipher-Blocksize(Keylength)
|
||||
return "SIMON-" + IntToString(L*8);
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief SIMON block cipher base class
|
||||
/// \tparam W the word type
|
||||
/// \details User code should use SIMON64 or SIMON128
|
||||
/// \sa SIMON64, SIMON128, <a href="http://www.cryptopp.com/wiki/SIMON">SIMON</a> on the Crypto++ wiki
|
||||
/// \since Crypto++ 6.0
|
||||
template <class W>
|
||||
struct SIMON_Base
|
||||
{
|
||||
virtual ~SIMON_Base() {}
|
||||
SIMON_Base() : m_kwords(0), m_rounds(0) {}
|
||||
|
||||
typedef SecBlock<W, AllocatorWithCleanup<W, true> > AlignedSecBlock;
|
||||
mutable AlignedSecBlock m_wspace; // workspace
|
||||
AlignedSecBlock m_rkeys; // round keys
|
||||
unsigned int m_kwords; // number of key words
|
||||
unsigned int m_rounds; // number of rounds
|
||||
};
|
||||
|
||||
/// \brief SIMON 64-bit block cipher
|
||||
/// \details Simon is a block cipher designed by Ray Beaulieu, Douglas Shors, Jason Smith,
|
||||
/// Stefan Treatman-Clark, Bryan Weeks and Louis Wingers.
|
||||
/// \details SIMON64 provides 64-bit block size. The valid key sizes are 96-bit and 128-bit.
|
||||
/// \sa SIMON64, SIMON128, <A HREF="http://eprint.iacr.org/2013/404">The SIMON and SIMON
|
||||
/// Families of Lightweight Block Ciphers</A>, <A HREF="http://iadgov.github.io/simon-speck/">
|
||||
/// The Simon and Speck GitHub</A>, <a href="http://www.cryptopp.com/wiki/SIMON">SIMON</a> on the
|
||||
/// Crypto++ wiki
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE SIMON64 : public SIMON_Info<8, 12, 12, 16>, public BlockCipherDocumentation
|
||||
{
|
||||
public:
|
||||
/// \brief SIMON64 block cipher base implementation
|
||||
/// \details Provides implementation common to encryption and decryption
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE Base : protected SIMON_Base<word32>, public BlockCipherImpl<SIMON_Info<8, 12, 12, 16> >
|
||||
{
|
||||
public:
|
||||
/// \brief The algorithm name
|
||||
/// \return the algorithm name
|
||||
/// \details AlgorithmName returns the algorithm's name as a
|
||||
/// member function.
|
||||
std::string AlgorithmName() const {
|
||||
return StaticAlgorithmName() + (m_kwords == 0 ? "" :
|
||||
"(" + IntToString(m_kwords*sizeof(word32)*8) + ")");
|
||||
}
|
||||
|
||||
std::string AlgorithmProvider() const;
|
||||
|
||||
/// \brief Provides input and output data alignment for optimal performance.
|
||||
/// \return the input data alignment that provides optimal performance
|
||||
/// \sa GetAlignment() and OptimalBlockSize()
|
||||
unsigned int OptimalDataAlignment() const;
|
||||
|
||||
protected:
|
||||
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs ¶ms);
|
||||
};
|
||||
|
||||
/// \brief SIMON64 encryption transformation
|
||||
/// \details Enc provides the encryption transformation.
|
||||
/// All key sizes are supported.
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE Enc : public Base
|
||||
{
|
||||
public:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
};
|
||||
|
||||
/// \brief SIMON64 decryption transformation
|
||||
/// \details Dec provides the decryption transformation.
|
||||
/// All key sizes are supported.
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE Dec : public Base
|
||||
{
|
||||
public:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
};
|
||||
|
||||
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
|
||||
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
||||
};
|
||||
|
||||
/// \brief SIMON 128-bit block cipher
|
||||
/// \details Simon is a block cipher designed by Ray Beaulieu, Douglas Shors, Jason Smith,
|
||||
/// Stefan Treatman-Clark, Bryan Weeks and Louis Wingers.
|
||||
/// \details SIMON128 provides 128-bit block size. The valid key sizes are 128-bit, 192-bit and 256-bit.
|
||||
/// \sa SIMON64, SIMON128, <A HREF="http://eprint.iacr.org/2013/404">The SIMON and SIMON
|
||||
/// Families of Lightweight Block Ciphers</A>, <A HREF="http://iadgov.github.io/simon-speck/">
|
||||
/// The Simon and Speck GitHub</A>, <a href="http://www.cryptopp.com/wiki/SIMON">SIMON</a> on the
|
||||
/// Crypto++ wiki
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE SIMON128 : public SIMON_Info<16, 16, 16, 32>, public BlockCipherDocumentation
|
||||
{
|
||||
public:
|
||||
/// \brief SIMON128 block cipher base implementation
|
||||
/// \details Provides implementation common to encryption and decryption
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE Base : protected SIMON_Base<word64>, public BlockCipherImpl<SIMON_Info<16, 16, 16, 32> >
|
||||
{
|
||||
public:
|
||||
/// \brief The algorithm name
|
||||
/// \return the algorithm name
|
||||
/// \details AlgorithmName returns the algorithm's name as a
|
||||
/// member function.
|
||||
std::string AlgorithmName() const {
|
||||
return StaticAlgorithmName() + (m_kwords == 0 ? "" :
|
||||
"(" + IntToString(m_kwords*sizeof(word64)*8) + ")");
|
||||
}
|
||||
|
||||
std::string AlgorithmProvider() const;
|
||||
|
||||
/// \brief Provides input and output data alignment for optimal performance.
|
||||
/// \return the input data alignment that provides optimal performance
|
||||
/// \sa GetAlignment() and OptimalBlockSize()
|
||||
unsigned int OptimalDataAlignment() const;
|
||||
|
||||
protected:
|
||||
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs ¶ms);
|
||||
};
|
||||
|
||||
/// \brief SIMON128 encryption transformation
|
||||
/// \details Enc provides the encryption transformation.
|
||||
/// All key sizes are supported.
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE Enc : public Base
|
||||
{
|
||||
public:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
#if CRYPTOPP_SIMON128_ADVANCED_PROCESS_BLOCKS
|
||||
size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/// \brief SIMON128 decryption transformation
|
||||
/// \details Dec provides the decryption transformation.
|
||||
/// All key sizes are supported.
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE Dec : public Base
|
||||
{
|
||||
public:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
#if CRYPTOPP_SIMON128_ADVANCED_PROCESS_BLOCKS
|
||||
size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
|
||||
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
||||
};
|
||||
|
||||
NAMESPACE_END
|
||||
|
||||
#endif // CRYPTOPP_SIMON_H
|
Loading…
Add table
Add a link
Reference in a new issue