AnCH Framework 0.1
Another C++ Hack Framework
 
Loading...
Searching...
No Matches
anch::crypto Namespace Reference

Cryptography namespace. More...

Classes

class  AES
 AES block cipher algorithm implementation. More...
 
struct  AesniKey
 
class  ANSIX923
 ANSI X.923 padding implementation. More...
 
class  Base64
 Base64 algorithm implementation. More...
 
class  BlockCipher
 Block cipher interface. More...
 
class  BlockCipherModeOfOperation
 Block cipher mode of operation interface. More...
 
class  CBC
 Cipher-block chaining implementation. More...
 
class  CFB
 Cipher feedback implementation. More...
 
class  CTR
 Counter implementation. More...
 
class  ECB
 Electronic codebook implementation. More...
 
class  Hash
 Hash algorithm abstract class. More...
 
class  InvalidBlockException
 Exception on receiving an invalid block. More...
 
class  ISO7816_4Padding
 ISO/IEC 7816-4 padding implementation. More...
 
class  MD5
 MD5 hash algorithm implementation. More...
 
class  OFB
 Output feedback implementation. More...
 
class  PCBC
 Propagating cipher-block chaining implementation. More...
 
class  PKCS5Padding
 PKCS5 padding implementation. More...
 
class  SHA1
 SHA1 hash algorithm implementation. More...
 
class  SHA2
 SHA2 abstract class. More...
 
class  ZeroPadding
 Zero padding implementation. More...
 

Typedefs

using AES128 = AES<4,10>
 
using AES192 = AES<6,12>
 
using AES256 = AES<8,14>
 
using SHA224 = SHA224_256<28,SHA224_VALUES>
 
using SHA256 = SHA224_256<32,SHA256_VALUES>
 
using SHA384 = SHA384_512<48,SHA384_VALUES>
 
using SHA512 = SHA384_512<64,SHA512_VALUES>
 

Functions

template<typename H>
HMAC (const std::string &, const std::string &)
 
template MD5 HMAC< MD5 > (const std::string &, const std::string &)
 
void registerMD5UUIDProvider ()
 
template SHA1 HMAC< SHA1 > (const std::string &, const std::string &)
 
void registerSHA1UUIDProvider ()
 
template SHA224 HMAC< SHA224 > (const std::string &, const std::string &)
 
template SHA256 HMAC< SHA256 > (const std::string &, const std::string &)
 
template SHA384 HMAC< SHA384 > (const std::string &, const std::string &)
 
template SHA512 HMAC< SHA512 > (const std::string &, const std::string &)
 

Variables

const uint8_t ANCH_AES_CIPHER_SBOX [256]
 
const uint8_t ANCH_AES_DECIPHER_SBOX [256]
 
const uint32_t ANCH_AES_RCON [11]
 
const uint8_t ANCH_GALOIS_MULT2 [256]
 
const uint8_t ANCH_GALOIS_MULT3 [256]
 
const uint8_t ANCH_GALOIS_MULT9 [256]
 
const uint8_t ANCH_GALOIS_MULT11 [256]
 
const uint8_t ANCH_GALOIS_MULT13 [256]
 
const uint8_t ANCH_GALOIS_MULT14 [256]
 
std::array< uint32_t, 8 > SHA224_VALUES
 
std::array< uint32_t, 8 > SHA256_VALUES
 
std::array< uint64_t, 8 > SHA384_VALUES
 
std::array< uint64_t, 8 > SHA512_VALUES
 

Detailed Description

Cryptography namespace.

It contains classes for cryptography facilities:

Typedef Documentation

◆ AES128

using anch::crypto::AES128 = AES<4,10>

AES-128 defintion

◆ AES192

using anch::crypto::AES192 = AES<6,12>

AES-192 defintion

◆ AES256

using anch::crypto::AES256 = AES<8,14>

AES-256 defintion

◆ SHA224

using anch::crypto::SHA224 = SHA224_256<28,SHA224_VALUES>

SHA224 definition

◆ SHA256

using anch::crypto::SHA256 = SHA224_256<32,SHA256_VALUES>

SHA256 defintion

◆ SHA384

using anch::crypto::SHA384 = SHA384_512<48,SHA384_VALUES>

SHA384 defintion

◆ SHA512

using anch::crypto::SHA512 = SHA384_512<64,SHA512_VALUES>

SHA512 defintion

Function Documentation

◆ HMAC()

template<typename H>
H anch::crypto::HMAC ( const std::string & key,
const std::string & message )

Compute HMAC according to hash algorithm, key and message.
This function uses C++ string for key and message.

Parameters
keythe key to use
messagethe message to use

◆ HMAC< MD5 >()

template MD5 anch::crypto::HMAC< MD5 > ( const std::string & ,
const std::string &  )
extern

HMAC MD5 definition

◆ HMAC< SHA1 >()

template SHA1 anch::crypto::HMAC< SHA1 > ( const std::string & ,
const std::string &  )
extern

HMAC SHA1 definition

◆ HMAC< SHA224 >()

template SHA224 anch::crypto::HMAC< SHA224 > ( const std::string & ,
const std::string &  )
extern

HMAC SHA224 definition

◆ HMAC< SHA256 >()

template SHA256 anch::crypto::HMAC< SHA256 > ( const std::string & ,
const std::string &  )
extern

HMAC SHA256 definition

◆ HMAC< SHA384 >()

template SHA384 anch::crypto::HMAC< SHA384 > ( const std::string & ,
const std::string &  )
extern

HMAC SHA384 definition

◆ HMAC< SHA512 >()

template SHA512 anch::crypto::HMAC< SHA512 > ( const std::string & ,
const std::string &  )
extern

HMAC SHA512 definition

◆ registerMD5UUIDProvider()

void anch::crypto::registerMD5UUIDProvider ( )

Register MD5 UUID provider

◆ registerSHA1UUIDProvider()

void anch::crypto::registerSHA1UUIDProvider ( )

Register SHA1 UUID provider

Variable Documentation

◆ ANCH_AES_CIPHER_SBOX

const uint8_t anch::crypto::ANCH_AES_CIPHER_SBOX[256]
extern

Cipher subsitution box

◆ ANCH_AES_DECIPHER_SBOX

const uint8_t anch::crypto::ANCH_AES_DECIPHER_SBOX[256]
extern

Decipher subsitution box

◆ ANCH_AES_RCON

const uint32_t anch::crypto::ANCH_AES_RCON[11]
extern

Round constants

◆ ANCH_GALOIS_MULT11

const uint8_t anch::crypto::ANCH_GALOIS_MULT11[256]
extern

Galois multiply by 11 lookup table

◆ ANCH_GALOIS_MULT13

const uint8_t anch::crypto::ANCH_GALOIS_MULT13[256]
extern

Galois multiply by 13 lookup table

◆ ANCH_GALOIS_MULT14

const uint8_t anch::crypto::ANCH_GALOIS_MULT14[256]
extern

Galois multiply by 14 lookup table

◆ ANCH_GALOIS_MULT2

const uint8_t anch::crypto::ANCH_GALOIS_MULT2[256]
extern

Galois multiply by 2 lookup table

◆ ANCH_GALOIS_MULT3

const uint8_t anch::crypto::ANCH_GALOIS_MULT3[256]
extern

Galois multiply by 3 lookup table

◆ ANCH_GALOIS_MULT9

const uint8_t anch::crypto::ANCH_GALOIS_MULT9[256]
extern

Galois multiply by 9 lookup table

◆ SHA224_VALUES

std::array<uint32_t,8> anch::crypto::SHA224_VALUES
extern

SHA224 initial values

◆ SHA256_VALUES

std::array<uint32_t,8> anch::crypto::SHA256_VALUES
extern

SHA256 initial values

◆ SHA384_VALUES

std::array<uint64_t,8> anch::crypto::SHA384_VALUES
extern

SHA384 initial values

◆ SHA512_VALUES

std::array<uint64_t,8> anch::crypto::SHA512_VALUES
extern

SHA512 initial values