Minetest  5.4.0
sha2.h File Reference
#include <stddef.h>
+ Include dependency graph for sha2.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SHAstate_st
 
struct  SHA256state_st
 

Macros

#define fips_md_init(alg)   fips_md_init_ctx(alg, alg)
 
#define fips_md_init_ctx(alg, cx)   int alg##_Init(cx##_CTX *c)
 
#define fips_cipher_abort(alg)   while (0)
 
#define SHA_LONG   unsigned int
 
#define SHA_LBLOCK   16
 
#define SHA_CBLOCK
 
#define SHA_LAST_BLOCK   (SHA_CBLOCK - 8)
 
#define SHA_DIGEST_LENGTH   20
 
#define SHA256_CBLOCK
 
#define SHA224_DIGEST_LENGTH   28
 
#define SHA256_DIGEST_LENGTH   32
 
#define SHA384_DIGEST_LENGTH   48
 
#define SHA512_DIGEST_LENGTH   64
 

Typedefs

typedef struct SHAstate_st SHA_CTX
 
typedef struct SHA256state_st SHA256_CTX
 

Functions

int SHA224_Init (SHA256_CTX *c)
 
int SHA224_Update (SHA256_CTX *c, const void *data, size_t len)
 
int SHA224_Final (unsigned char *md, SHA256_CTX *c)
 
unsigned char * SHA224 (const unsigned char *d, size_t n, unsigned char *md)
 
int SHA256_Init (SHA256_CTX *c)
 
int SHA256_Update (SHA256_CTX *c, const void *data, size_t len)
 
int SHA256_Final (unsigned char *md, SHA256_CTX *c)
 
unsigned char * SHA256 (const unsigned char *d, size_t n, unsigned char *md)
 
void SHA256_Transform (SHA256_CTX *c, const unsigned char *data)
 

Macro Definition Documentation

◆ fips_cipher_abort

#define fips_cipher_abort (   alg)    while (0)

◆ fips_md_init

#define fips_md_init (   alg)    fips_md_init_ctx(alg, alg)

◆ fips_md_init_ctx

#define fips_md_init_ctx (   alg,
  cx 
)    int alg##_Init(cx##_CTX *c)

◆ SHA224_DIGEST_LENGTH

#define SHA224_DIGEST_LENGTH   28

◆ SHA256_CBLOCK

#define SHA256_CBLOCK
Value:
(SHA_LBLOCK * 4) /* SHA-256 treats input data as a \
* contiguous array of 32 bit wide \
* big-endian values. */
#define SHA_LBLOCK
Definition: sha2.h:102

◆ SHA256_DIGEST_LENGTH

#define SHA256_DIGEST_LENGTH   32

◆ SHA384_DIGEST_LENGTH

#define SHA384_DIGEST_LENGTH   48

◆ SHA512_DIGEST_LENGTH

#define SHA512_DIGEST_LENGTH   64

◆ SHA_CBLOCK

#define SHA_CBLOCK
Value:
(SHA_LBLOCK * 4) /* SHA treats input data as a \
* contiguous array of 32 bit wide \
* big-endian values. */

◆ SHA_DIGEST_LENGTH

#define SHA_DIGEST_LENGTH   20

◆ SHA_LAST_BLOCK

#define SHA_LAST_BLOCK   (SHA_CBLOCK - 8)

◆ SHA_LBLOCK

#define SHA_LBLOCK   16

◆ SHA_LONG

#define SHA_LONG   unsigned int

Typedef Documentation

◆ SHA256_CTX

typedef struct SHA256state_st SHA256_CTX

◆ SHA_CTX

typedef struct SHAstate_st SHA_CTX

Function Documentation

◆ SHA224()

unsigned char* SHA224 ( const unsigned char *  d,
size_t  n,
unsigned char *  md 
)

References OPENSSL_cleanse(), SHA224_DIGEST_LENGTH, SHA224_Init(), SHA256_Final(), and SHA256_Update().

+ Here is the call graph for this function:

◆ SHA224_Final()

int SHA224_Final ( unsigned char *  md,
SHA256_CTX c 
)

References SHA256_Final().

+ Here is the call graph for this function:

◆ SHA224_Init()

int SHA224_Init ( SHA256_CTX c)

Referenced by SHA224().

+ Here is the caller graph for this function:

◆ SHA224_Update()

int SHA224_Update ( SHA256_CTX c,
const void *  data,
size_t  len 
)

References SHA256_Update().

+ Here is the call graph for this function:

◆ SHA256()

unsigned char* SHA256 ( const unsigned char *  d,
size_t  n,
unsigned char *  md 
)

References OPENSSL_cleanse(), SHA256_DIGEST_LENGTH, SHA256_Final(), SHA256_Init(), and SHA256_Update().

Referenced by hash().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SHA256_Final()

int SHA256_Final ( unsigned char *  md,
SHA256_CTX c 
)

Referenced by hash_final(), SHA224(), SHA224_Final(), and SHA256().

+ Here is the caller graph for this function:

◆ SHA256_Init()

int SHA256_Init ( SHA256_CTX c)

Referenced by hash_init(), and SHA256().

+ Here is the caller graph for this function:

◆ SHA256_Transform()

void SHA256_Transform ( SHA256_CTX c,
const unsigned char *  data 
)

◆ SHA256_Update()

int SHA256_Update ( SHA256_CTX c,
const void *  data,
size_t  len 
)

Referenced by hash_update(), SHA224(), SHA224_Update(), and SHA256().

+ Here is the caller graph for this function: