ReactOS  0.4.14-dev-608-gd495a4f
sha1.h File Reference
#include "config.h"
#include <stddef.h>
#include <stdint.h>
Include dependency graph for sha1.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mbedtls_sha1_context
 The SHA-1 context structure. More...
 

Macros

#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED   -0x0035
 
#define MBEDTLS_DEPRECATED
 
#define MBEDTLS_DEPRECATED
 

Functions

void mbedtls_sha1_init (mbedtls_sha1_context *ctx)
 This function initializes a SHA-1 context. More...
 
void mbedtls_sha1_free (mbedtls_sha1_context *ctx)
 This function clears a SHA-1 context. More...
 
void mbedtls_sha1_clone (mbedtls_sha1_context *dst, const mbedtls_sha1_context *src)
 This function clones the state of a SHA-1 context. More...
 
int mbedtls_sha1_starts_ret (mbedtls_sha1_context *ctx)
 This function starts a SHA-1 checksum calculation. More...
 
int mbedtls_sha1_update_ret (mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen)
 This function feeds an input buffer into an ongoing SHA-1 checksum calculation. More...
 
int mbedtls_sha1_finish_ret (mbedtls_sha1_context *ctx, unsigned char output[20])
 This function finishes the SHA-1 operation, and writes the result to the output buffer. More...
 
int mbedtls_internal_sha1_process (mbedtls_sha1_context *ctx, const unsigned char data[64])
 SHA-1 process data block (internal use only) More...
 
MBEDTLS_DEPRECATED void mbedtls_sha1_starts (mbedtls_sha1_context *ctx)
 SHA-1 context setup. More...
 
MBEDTLS_DEPRECATED void mbedtls_sha1_update (mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen)
 SHA-1 process buffer. More...
 
MBEDTLS_DEPRECATED void mbedtls_sha1_finish (mbedtls_sha1_context *ctx, unsigned char output[20])
 SHA-1 final digest. More...
 
MBEDTLS_DEPRECATED void mbedtls_sha1_process (mbedtls_sha1_context *ctx, const unsigned char data[64])
 SHA-1 process data block (internal use only) More...
 
int mbedtls_sha1_ret (const unsigned char *input, size_t ilen, unsigned char output[20])
 This function calculates the SHA-1 checksum of a buffer. More...
 
MBEDTLS_DEPRECATED void mbedtls_sha1 (const unsigned char *input, size_t ilen, unsigned char output[20])
 Output = SHA-1( input buffer ) More...
 
int mbedtls_sha1_self_test (int verbose)
 The SHA-1 checkup routine. More...
 

Macro Definition Documentation

◆ MBEDTLS_DEPRECATED [1/2]

#define MBEDTLS_DEPRECATED

Definition at line 285 of file sha1.h.

◆ MBEDTLS_DEPRECATED [2/2]

#define MBEDTLS_DEPRECATED

Definition at line 285 of file sha1.h.

◆ MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED

#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED   -0x0035

SHA-1 hardware accelerator failed

Definition at line 42 of file sha1.h.

Function Documentation

◆ mbedtls_internal_sha1_process()

int mbedtls_internal_sha1_process ( mbedtls_sha1_context ctx,
const unsigned char  data[64] 
)

SHA-1 process data block (internal use only)

Parameters
ctxSHA-1 context
dataThe data block being processed.
Returns
0 if successful
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1()

MBEDTLS_DEPRECATED void mbedtls_sha1 ( const unsigned char input,
size_t  ilen,
unsigned char  output[20] 
)

Output = SHA-1( input buffer )

Deprecated:
Superseded by mbedtls_sha1_ret() in 2.7.0
Parameters
inputThe buffer holding the input data.
ilenThe length of the input data.
outputThe SHA-1 checksum result.
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_clone()

void mbedtls_sha1_clone ( mbedtls_sha1_context dst,
const mbedtls_sha1_context src 
)

This function clones the state of a SHA-1 context.

Parameters
dstThe destination context.
srcThe context to clone.
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_finish()

MBEDTLS_DEPRECATED void mbedtls_sha1_finish ( mbedtls_sha1_context ctx,
unsigned char  output[20] 
)

SHA-1 final digest.

Deprecated:
Superseded by mbedtls_sha1_finish_ret() in 2.7.0
Parameters
ctxThe SHA-1 context.
outputThe SHA-1 checksum result.
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_finish_ret()

int mbedtls_sha1_finish_ret ( mbedtls_sha1_context ctx,
unsigned char  output[20] 
)

This function finishes the SHA-1 operation, and writes the result to the output buffer.

Parameters
ctxThe SHA-1 context.
outputThe SHA-1 checksum result.
Returns
0 if successful
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_free()

void mbedtls_sha1_free ( mbedtls_sha1_context ctx)

This function clears a SHA-1 context.

Parameters
ctxThe SHA-1 context to clear.
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_init()

void mbedtls_sha1_init ( mbedtls_sha1_context ctx)

This function initializes a SHA-1 context.

Parameters
ctxThe SHA-1 context to initialize.
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_process()

MBEDTLS_DEPRECATED void mbedtls_sha1_process ( mbedtls_sha1_context ctx,
const unsigned char  data[64] 
)

SHA-1 process data block (internal use only)

Deprecated:
Superseded by mbedtls_internal_sha1_process() in 2.7.0
Parameters
ctxThe SHA-1 context.
dataThe data block being processed.
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_ret()

int mbedtls_sha1_ret ( const unsigned char input,
size_t  ilen,
unsigned char  output[20] 
)

This function calculates the SHA-1 checksum of a buffer.

            The function allocates the context, performs the
            calculation, and frees the context.

            The SHA-1 result is calculated as
            output = SHA-1(input buffer).
Parameters
inputThe buffer holding the input data.
ilenThe length of the input data.
outputThe SHA-1 checksum result.
Returns
0 if successful
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_self_test()

int mbedtls_sha1_self_test ( int  verbose)

The SHA-1 checkup routine.

Returns
0 on success, or 1 on failure.
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_starts()

MBEDTLS_DEPRECATED void mbedtls_sha1_starts ( mbedtls_sha1_context ctx)

SHA-1 context setup.

Deprecated:
Superseded by mbedtls_sha1_starts_ret() in 2.7.0
Parameters
ctxThe SHA-1 context to be initialized.
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_starts_ret()

int mbedtls_sha1_starts_ret ( mbedtls_sha1_context ctx)

This function starts a SHA-1 checksum calculation.

Parameters
ctxThe context to initialize.
Returns
0 if successful
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_update()

MBEDTLS_DEPRECATED void mbedtls_sha1_update ( mbedtls_sha1_context ctx,
const unsigned char input,
size_t  ilen 
)

SHA-1 process buffer.

Deprecated:
Superseded by mbedtls_sha1_update_ret() in 2.7.0
Parameters
ctxThe SHA-1 context.
inputThe buffer holding the input data.
ilenThe length of the input data.
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_sha1_update_ret()

int mbedtls_sha1_update_ret ( mbedtls_sha1_context ctx,
const unsigned char input,
size_t  ilen 
)

This function feeds an input buffer into an ongoing SHA-1 checksum calculation.

Parameters
ctxThe SHA-1 context.
inputThe buffer holding the input data.
ilenThe length of the input data.
Returns
0 if successful
Warning
SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.