#include <signal.h>#include <string>


Ir al código fuente de este archivo.
Namespaces | |
| namespace | Mt77 |
Clases | |
| struct | sha256_state |
| union | Hash_state |
| struct | ltc_hash_descriptor |
Definiciones | |
| #define | ENDIAN_LITTLE |
| #define | CRYPT 0x0116 |
| #define | SCRYPT "1.16" |
| #define | MAXBLOCKSIZE 128 |
| #define | TAB_SIZE 32 |
| #define | CONST64(n) n ## ULL |
| #define | STORE32H(x, y) |
| #define | LOAD32H(x, y) |
| #define | STORE64H(x, y) |
| #define | LOAD64H(x, y) |
| #define | STORE32L(x, y) { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } |
| #define | LOAD32L(x, y) { XMEMCPY(&(x), y, 4); x &= 0xFFFFFFFF; } |
| #define | STORE64L(x, y) { ulong64 __t = (x); XMEMCPY(y, &__t, 8); } |
| #define | LOAD64L(x, y) { XMEMCPY(&(x), y, 8); } |
| #define | BSWAP(x) |
| #define | ROLc ROL |
| #define | RORc ROR |
| #define | ROL(x, y) ( (((unsigned long)(x)<<(unsigned long)((y)&31)) | (((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) |
| #define | ROR(x, y) ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) |
| #define | ROL64c ROL64 |
| #define | ROR64c ROR64 |
| #define | ROL64(x, y) |
| #define | ROR64(x, y) |
| #define | MAX(x, y) ( ((x)>(y))?(x):(y) ) |
| #define | MIN(x, y) ( ((x)<(y))?(x):(y) ) |
| #define | byte(x, n) (((x) >> (8 * (n))) & 255) |
| #define | LTC_ARGCHK(x) if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } |
| #define | LTC_ARGCHKVD(x) LTC_ARGCHK(x) |
| #define | HASH_PROCESS(func_name, compress_name, state_var, block_size) |
Tipos definidos | |
| typedef unsigned long long | ulong64 |
| typedef unsigned | ulong32 |
| typedef union Hash_state | hash_state |
Enumeraciones | |
| enum | { CRYPT_OK = 0, CRYPT_ERROR, CRYPT_NOP, CRYPT_INVALID_KEYSIZE, CRYPT_INVALID_ROUNDS, CRYPT_FAIL_TESTVECTOR, CRYPT_BUFFER_OVERFLOW, CRYPT_INVALID_PACKET, CRYPT_INVALID_PRNGSIZE, CRYPT_ERROR_READPRNG, CRYPT_INVALID_CIPHER, CRYPT_INVALID_HASH, CRYPT_INVALID_PRNG, CRYPT_MEM, CRYPT_PK_TYPE_MISMATCH, CRYPT_PK_NOT_PRIVATE, CRYPT_INVALID_ARG, CRYPT_FILE_NOTFOUND, CRYPT_PK_INVALID_TYPE, CRYPT_PK_INVALID_SYSTEM, CRYPT_PK_DUP, CRYPT_PK_NOT_FOUND, CRYPT_PK_INVALID_SIZE, CRYPT_INVALID_PRIME_SIZE, CRYPT_PK_INVALID_PADDING } |
Funciones | |
| void | crypt_argchk (char *v, char *s, int d) |
| int | sha256_init (hash_state *md) |
| int | sha256_process (hash_state *md, const unsigned char *in, unsigned long inlen) |
| int | sha256_done (hash_state *md, unsigned char *hash) |
| std::string | sha256archivo (std::string narch) |
Variables | |
| struct ltc_hash_descriptor | hash_descriptor [] |
| struct ltc_hash_descriptor | sha256_desc |
Agradablemente copiado de sha256.c y encabezados de LibTomCrypt 1.16
Definición en el archivo sha256.hpp.
| #define BSWAP | ( | x | ) |
Valor:
( ((x>>24)&0x000000FFUL) | ((x<<24)&0xFF000000UL) | \
((x>>8)&0x0000FF00UL) | ((x<<8)&0x00FF0000UL) )
Definición en la línea 288 del archivo sha256.hpp.
| #define byte | ( | x, | |||
| n | ) | (((x) >> (8 * (n))) & 255) |
Definición en la línea 324 del archivo sha256.hpp.
| #define CONST64 | ( | n | ) | n ## ULL |
Definición en la línea 73 del archivo sha256.hpp.
| #define CRYPT 0x0116 |
Definición en la línea 24 del archivo sha256.hpp.
| #define ENDIAN_LITTLE |
Definición en la línea 20 del archivo sha256.hpp.
| #define HASH_PROCESS | ( | func_name, | |||
| compress_name, | |||||
| state_var, | |||||
| block_size | ) |
Definición en la línea 435 del archivo sha256.hpp.
| #define LOAD32H | ( | x, | |||
| y | ) |
Valor:
{ x = ((unsigned long)((y)[0] & 255)<<24) | \
((unsigned long)((y)[1] & 255)<<16) | \
((unsigned long)((y)[2] & 255)<<8) | \
((unsigned long)((y)[3] & 255)); }
Definición en la línea 149 del archivo sha256.hpp.
| #define LOAD32L | ( | x, | |||
| y | ) | { XMEMCPY(&(x), y, 4); x &= 0xFFFFFFFF; } |
Definición en la línea 215 del archivo sha256.hpp.
| #define LOAD64H | ( | x, | |||
| y | ) |
Valor:
{ x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \
(((ulong64)((y)[2] & 255))<<40)|(((ulong64)((y)[3] & 255))<<32) | \
(((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16) | \
(((ulong64)((y)[6] & 255))<<8)|(((ulong64)((y)[7] & 255))); }
Definición en la línea 182 del archivo sha256.hpp.
| #define LOAD64L | ( | x, | |||
| y | ) | { XMEMCPY(&(x), y, 8); } |
Definición en la línea 221 del archivo sha256.hpp.
| #define LTC_ARGCHK | ( | x | ) | if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } |
| #define LTC_ARGCHKVD | ( | x | ) | LTC_ARGCHK(x) |
Definición en la línea 336 del archivo sha256.hpp.
| #define MAX | ( | x, | |||
| y | ) | ( ((x)>(y))?(x):(y) ) |
Definición en la línea 313 del archivo sha256.hpp.
| #define MAXBLOCKSIZE 128 |
Definición en la línea 28 del archivo sha256.hpp.
| #define MIN | ( | x, | |||
| y | ) | ( ((x)<(y))?(x):(y) ) |
Definición en la línea 317 del archivo sha256.hpp.
| #define ROL | ( | x, | |||
| y | ) | ( (((unsigned long)(x)<<(unsigned long)((y)&31)) | (((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) |
Definición en la línea 297 del archivo sha256.hpp.
| #define ROL64 | ( | x, | |||
| y | ) |
| #define ROL64c ROL64 |
Definición en la línea 301 del archivo sha256.hpp.
| #define ROLc ROL |
Definición en la línea 292 del archivo sha256.hpp.
| #define ROR | ( | x, | |||
| y | ) | ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) |
Definición en la línea 298 del archivo sha256.hpp.
| #define ROR64 | ( | x, | |||
| y | ) |
| #define ROR64c ROR64 |
Definición en la línea 302 del archivo sha256.hpp.
| #define RORc ROR |
Definición en la línea 293 del archivo sha256.hpp.
| #define SCRYPT "1.16" |
Definición en la línea 25 del archivo sha256.hpp.
| #define STORE32H | ( | x, | |||
| y | ) |
Valor:
{ (y)[0] = (unsigned char)(((x)>>24)&255); (y)[1] = (unsigned char)(((x)>>16)&255); \
(y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); }
Definición en la línea 145 del archivo sha256.hpp.
Referenciado por sha256_done().
| #define STORE32L | ( | x, | |||
| y | ) | { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } |
Definición en la línea 212 del archivo sha256.hpp.
| #define STORE64H | ( | x, | |||
| y | ) |
Valor:
{ (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \
(y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \
(y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \
(y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); }
Definición en la línea 176 del archivo sha256.hpp.
Referenciado por sha256_done().
| #define STORE64L | ( | x, | |||
| y | ) | { ulong64 __t = (x); XMEMCPY(y, &__t, 8); } |
Definición en la línea 218 del archivo sha256.hpp.
| #define TAB_SIZE 32 |
Definición en la línea 31 del archivo sha256.hpp.
| typedef union Hash_state hash_state |
| typedef unsigned ulong32 |
Definición en la línea 76 del archivo sha256.hpp.
| typedef unsigned long long ulong64 |
Definición en la línea 74 del archivo sha256.hpp.
| anonymous enum |
Definición en la línea 34 del archivo sha256.hpp.
| void crypt_argchk | ( | char * | v, | |
| char * | s, | |||
| int | d | |||
| ) |
Definición en la línea 33 del archivo sha256.cpp.
| int sha256_done | ( | hash_state * | md, | |
| unsigned char * | hash | |||
| ) |
Termina el cálculo para retornar el condensado final.
| md | Estado del condensado | |
| hash | [out] Destino del condensado (32 bytes) |
Definición en la línea 254 del archivo sha256.cpp.
Hace referencia a CRYPT_INVALID_ARG, CRYPT_OK, LTC_ARGCHK, STORE32H, y STORE64H.
Referenciado por sha256archivo().
| int sha256_init | ( | hash_state * | md | ) |
Inicializa el estado del condensado
| md | Estado del condensado que usted desea inicializar |
Definición en la línea 235 del archivo sha256.cpp.
Hace referencia a CRYPT_OK, sha256_state::curlen, sha256_state::length, LTC_ARGCHK, Hash_state::sha256, y sha256_state::state.
Referenciado por sha256archivo().
| int sha256_process | ( | hash_state * | md, | |
| const unsigned char * | in, | |||
| unsigned long | inlen | |||
| ) |
Procesa un bloque de memoria por el calculador de condensado
| md | Estado del condensado | |
| in | Datos por pasar por el hash | |
| inlen | Longitud de los datos en in (octetos) |
Referenciado por sha256archivo().
| std::string sha256archivo | ( | std::string | narch | ) |
Calcula sha256 al archivo dado
| narch | nombre de archivo (debe existir) |
Definición en la línea 329 del archivo sha256.cpp.
Hace referencia a hexaDeHash(), sha256_done(), sha256_init(), y sha256_process().
Referenciado por indexa(), y main().

| struct ltc_hash_descriptor hash_descriptor[] |
| struct ltc_hash_descriptor sha256_desc |
Definición en la línea 40 del archivo sha256.cpp.
1.5.4