FreeRDP
libwinpr/crypto/hash.c File Reference
#include <winpr/config.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/crypto.h>
#include "../log.h"

Macros

#define TAG   WINPR_TAG("crypto.hash")
 

Functions

WINPR_MD_TYPE winpr_md_type_from_string (const char *name)
 
const char * winpr_md_type_to_string (WINPR_MD_TYPE md)
 
WINPR_HMAC_CTX * winpr_HMAC_New (void)
 
BOOL winpr_HMAC_Init (WINPR_HMAC_CTX *ctx, WINPR_MD_TYPE md, const void *key, size_t keylen)
 
BOOL winpr_HMAC_Update (WINPR_HMAC_CTX *ctx, const void *input, size_t ilen)
 
BOOL winpr_HMAC_Final (WINPR_HMAC_CTX *ctx, void *output, size_t olen)
 
void winpr_HMAC_Free (WINPR_HMAC_CTX *ctx)
 
BOOL winpr_HMAC (WINPR_MD_TYPE md, const void *key, size_t keylen, const void *input, size_t ilen, void *output, size_t olen)
 
WINPR_DIGEST_CTX * winpr_Digest_New (void)
 
BOOL winpr_Digest_Init_Allow_FIPS (WINPR_DIGEST_CTX *ctx, WINPR_MD_TYPE md)
 
BOOL winpr_Digest_Init (WINPR_DIGEST_CTX *ctx, WINPR_MD_TYPE md)
 
BOOL winpr_Digest_Update (WINPR_DIGEST_CTX *ctx, const void *input, size_t ilen)
 
BOOL winpr_Digest_Final (WINPR_DIGEST_CTX *ctx, void *output, size_t olen)
 
BOOL winpr_DigestSign_Init (WINPR_DIGEST_CTX *ctx, WINPR_MD_TYPE digest, void *key)
 
BOOL winpr_DigestSign_Update (WINPR_DIGEST_CTX *ctx, const void *input, size_t ilen)
 
BOOL winpr_DigestSign_Final (WINPR_DIGEST_CTX *ctx, void *output, size_t *piolen)
 
void winpr_Digest_Free (WINPR_DIGEST_CTX *ctx)
 
BOOL winpr_Digest_Allow_FIPS (WINPR_MD_TYPE md, const void *input, size_t ilen, void *output, size_t olen)
 
BOOL winpr_Digest (WINPR_MD_TYPE md, const void *input, size_t ilen, void *output, size_t olen)
 

Variables

static const struct hash_map hashes []
 

Macro Definition Documentation

◆ TAG

#define TAG   WINPR_TAG("crypto.hash")

WinPR: Windows Portable Runtime

Copyright 2015 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ winpr_Digest()

BOOL winpr_Digest ( WINPR_MD_TYPE  md,
const void *  input,
size_t  ilen,
void *  output,
size_t  olen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_Digest_Allow_FIPS()

BOOL winpr_Digest_Allow_FIPS ( WINPR_MD_TYPE  md,
const void *  input,
size_t  ilen,
void *  output,
size_t  olen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_Digest_Final()

BOOL winpr_Digest_Final ( WINPR_DIGEST_CTX *  ctx,
void *  output,
size_t  olen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_Digest_Free()

void winpr_Digest_Free ( WINPR_DIGEST_CTX *  ctx)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_Digest_Init()

BOOL winpr_Digest_Init ( WINPR_DIGEST_CTX *  ctx,
WINPR_MD_TYPE  md 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_Digest_Init_Allow_FIPS()

BOOL winpr_Digest_Init_Allow_FIPS ( WINPR_DIGEST_CTX *  ctx,
WINPR_MD_TYPE  md 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_Digest_New()

WINPR_DIGEST_CTX* winpr_Digest_New ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_Digest_Update()

BOOL winpr_Digest_Update ( WINPR_DIGEST_CTX *  ctx,
const void *  input,
size_t  ilen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_DigestSign_Final()

BOOL winpr_DigestSign_Final ( WINPR_DIGEST_CTX *  ctx,
void *  output,
size_t *  piolen 
)

◆ winpr_DigestSign_Init()

BOOL winpr_DigestSign_Init ( WINPR_DIGEST_CTX *  ctx,
WINPR_MD_TYPE  digest,
void *  key 
)
Here is the caller graph for this function:

◆ winpr_DigestSign_Update()

BOOL winpr_DigestSign_Update ( WINPR_DIGEST_CTX *  ctx,
const void *  input,
size_t  ilen 
)

◆ winpr_HMAC()

BOOL winpr_HMAC ( WINPR_MD_TYPE  md,
const void *  key,
size_t  keylen,
const void *  input,
size_t  ilen,
void *  output,
size_t  olen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_HMAC_Final()

BOOL winpr_HMAC_Final ( WINPR_HMAC_CTX *  ctx,
void *  output,
size_t  olen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_HMAC_Free()

void winpr_HMAC_Free ( WINPR_HMAC_CTX *  ctx)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_HMAC_Init()

BOOL winpr_HMAC_Init ( WINPR_HMAC_CTX *  ctx,
WINPR_MD_TYPE  md,
const void *  key,
size_t  keylen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_HMAC_New()

WINPR_HMAC_CTX* winpr_HMAC_New ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_HMAC_Update()

BOOL winpr_HMAC_Update ( WINPR_HMAC_CTX *  ctx,
const void *  input,
size_t  ilen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_md_type_from_string()

WINPR_MD_TYPE winpr_md_type_from_string ( const char *  name)
Here is the call graph for this function:

◆ winpr_md_type_to_string()

const char* winpr_md_type_to_string ( WINPR_MD_TYPE  md)
Here is the caller graph for this function:

Variable Documentation

◆ hashes

const struct hash_map hashes[]
static
Initial value:
= { { "md2", WINPR_MD_MD2 },
{ "md4", WINPR_MD_MD4 },
{ "md5", WINPR_MD_MD5 },
{ "sha1", WINPR_MD_SHA1 },
{ "sha224", WINPR_MD_SHA224 },
{ "sha256", WINPR_MD_SHA256 },
{ "sha384", WINPR_MD_SHA384 },
{ "sha512", WINPR_MD_SHA512 },
{ "sha3_224", WINPR_MD_SHA3_224 },
{ "sha3_256", WINPR_MD_SHA3_256 },
{ "sha3_384", WINPR_MD_SHA3_384 },
{ "sha3_512", WINPR_MD_SHA3_512 },
{ "shake128", WINPR_MD_SHAKE128 },
{ "shake256", WINPR_MD_SHAKE256 },
if availableBytes return NULL
Definition: TPCircularBuffer.h:109
@ WINPR_MD_SHA512
Definition: custom-crypto.h:60
@ WINPR_MD_MD5
Definition: custom-crypto.h:55
@ WINPR_MD_SHAKE256
Definition: custom-crypto.h:67
@ WINPR_MD_NONE
Definition: custom-crypto.h:52
@ WINPR_MD_SHA384
Definition: custom-crypto.h:59
@ WINPR_MD_SHA256
Definition: custom-crypto.h:58
@ WINPR_MD_MD2
Definition: custom-crypto.h:53
@ WINPR_MD_MD4
Definition: custom-crypto.h:54
@ WINPR_MD_SHA3_384
Definition: custom-crypto.h:64
@ WINPR_MD_SHA1
Definition: custom-crypto.h:56
@ WINPR_MD_SHA3_256
Definition: custom-crypto.h:63
@ WINPR_MD_SHA224
Definition: custom-crypto.h:57
@ WINPR_MD_SHA3_224
Definition: custom-crypto.h:62
@ WINPR_MD_SHAKE128
Definition: custom-crypto.h:66
@ WINPR_MD_SHA3_512
Definition: custom-crypto.h:65