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
96
third_party/cryptoppwin/include/cryptopp/sm4.h
vendored
Normal file
96
third_party/cryptoppwin/include/cryptopp/sm4.h
vendored
Normal file
|
@ -0,0 +1,96 @@
|
|||
// sm4.h - written and placed in the public domain by Jeffrey Walton and Han Lulu
|
||||
|
||||
/// \file sm4.h
|
||||
/// \brief Classes for the SM4 block cipher
|
||||
/// \details SM4 is a block cipher designed by Xiaoyun Wang, et al. The block cipher is part of the
|
||||
/// Chinese State Cryptography Administration portfolio. The cipher was formerly known as SMS4.
|
||||
/// \details SM4 encryption is accelerated on machines with AES-NI. Decryption is not accelerated because
|
||||
/// it is not profitable. Thanks to Markku-Juhani Olavi Saarinen for help and the code.
|
||||
/// \sa <A HREF="http://eprint.iacr.org/2008/329.pdf">SMS4 Encryption Algorithm for Wireless Networks</A>,
|
||||
/// <A HREF="http://github.com/guanzhi/GmSSL">Reference implementation using OpenSSL</A> and
|
||||
/// <A HREF="https://github.com/mjosaarinen/sm4ni">Markku-Juhani Olavi Saarinen GitHub</A>.
|
||||
/// \since Crypto++ 6.0
|
||||
|
||||
#ifndef CRYPTOPP_SM4_H
|
||||
#define CRYPTOPP_SM4_H
|
||||
|
||||
#include "config.h"
|
||||
#include "seckey.h"
|
||||
#include "secblock.h"
|
||||
|
||||
#if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86)
|
||||
# ifndef CRYPTOPP_DISABLE_SM4_SIMD
|
||||
# define CRYPTOPP_SM4_ADVANCED_PROCESS_BLOCKS 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
/// \brief SM4 block cipher information
|
||||
/// \since Crypto++ 6.0
|
||||
struct SM4_Info : public FixedBlockSize<16>, FixedKeyLength<16>
|
||||
{
|
||||
static const std::string StaticAlgorithmName()
|
||||
{
|
||||
return "SM4";
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief Classes for the SM4 block cipher
|
||||
/// \details SM4 is a block cipher designed by Xiaoyun Wang, et al. The block cipher is part of the
|
||||
/// Chinese State Cryptography Administration portfolio. The cipher was formerly known as SMS4.
|
||||
/// \sa <A HREF="http://eprint.iacr.org/2008/329.pdf">SMS4 Encryption Algorithm for Wireless Networks</A>
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE SM4 : public SM4_Info, public BlockCipherDocumentation
|
||||
{
|
||||
public:
|
||||
/// \brief SM4 block cipher transformation functions
|
||||
/// \details Provides implementation common to encryption and decryption
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SM4_Info>
|
||||
{
|
||||
protected:
|
||||
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs ¶ms);
|
||||
|
||||
SecBlock<word32, AllocatorWithCleanup<word32> > m_rkeys;
|
||||
mutable SecBlock<word32, AllocatorWithCleanup<word32> > m_wspace;
|
||||
};
|
||||
|
||||
/// \brief Encryption transformation
|
||||
/// \details Enc provides implementation for encryption transformation. All key
|
||||
/// sizes are supported.
|
||||
/// \details SM4 encryption is accelerated on machines with AES-NI. Decryption is
|
||||
/// not accelerated because it is not profitable. Thanks to Markku-Juhani Olavi
|
||||
/// Saarinen.
|
||||
/// \since Crypto++ 6.0, AESNI encryption since Crypto++ 8.0
|
||||
class CRYPTOPP_NO_VTABLE Enc : public Base
|
||||
{
|
||||
public:
|
||||
std::string AlgorithmProvider() const;
|
||||
protected:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
#if CRYPTOPP_SM4_ADVANCED_PROCESS_BLOCKS
|
||||
size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
|
||||
#endif
|
||||
};
|
||||
|
||||
/// \brief Decryption transformation
|
||||
/// \details Dec provides implementation for decryption transformation. All key
|
||||
/// sizes are supported.
|
||||
/// \details SM4 encryption is accelerated on machines with AES-NI. Decryption is
|
||||
/// not accelerated because it is not profitable. Thanks to Markku-Juhani Olavi
|
||||
/// Saarinen.
|
||||
/// \since Crypto++ 6.0
|
||||
class CRYPTOPP_NO_VTABLE Dec : public Base
|
||||
{
|
||||
protected:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
};
|
||||
|
||||
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
|
||||
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
||||
};
|
||||
|
||||
NAMESPACE_END
|
||||
|
||||
#endif // CRYPTOPP_SM4_H
|
Loading…
Add table
Add a link
Reference in a new issue