mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
- Major type rewrite of int to size_t for most variables and arguments used for buffer lengths and loops
This commit is contained in:
parent
1be81a4e5f
commit
23986e5d5d
67 changed files with 1041 additions and 949 deletions
|
|
@ -27,6 +27,8 @@
|
|||
#ifndef POLARSSL_SHA2_H
|
||||
#define POLARSSL_SHA2_H
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/**
|
||||
* \brief SHA-256 context structure
|
||||
*/
|
||||
|
|
@ -61,7 +63,7 @@ void sha2_starts( sha2_context *ctx, int is224 );
|
|||
* \param input buffer holding the data
|
||||
* \param ilen length of the input data
|
||||
*/
|
||||
void sha2_update( sha2_context *ctx, const unsigned char *input, int ilen );
|
||||
void sha2_update( sha2_context *ctx, const unsigned char *input, size_t ilen );
|
||||
|
||||
/**
|
||||
* \brief SHA-256 final digest
|
||||
|
|
@ -79,7 +81,7 @@ void sha2_finish( sha2_context *ctx, unsigned char output[32] );
|
|||
* \param output SHA-224/256 checksum result
|
||||
* \param is224 0 = use SHA256, 1 = use SHA224
|
||||
*/
|
||||
void sha2( const unsigned char *input, int ilen,
|
||||
void sha2( const unsigned char *input, size_t ilen,
|
||||
unsigned char output[32], int is224 );
|
||||
|
||||
/**
|
||||
|
|
@ -102,7 +104,7 @@ int sha2_file( const char *path, unsigned char output[32], int is224 );
|
|||
* \param keylen length of the HMAC key
|
||||
* \param is224 0 = use SHA256, 1 = use SHA224
|
||||
*/
|
||||
void sha2_hmac_starts( sha2_context *ctx, const unsigned char *key, int keylen,
|
||||
void sha2_hmac_starts( sha2_context *ctx, const unsigned char *key, size_t keylen,
|
||||
int is224 );
|
||||
|
||||
/**
|
||||
|
|
@ -112,7 +114,7 @@ void sha2_hmac_starts( sha2_context *ctx, const unsigned char *key, int keylen,
|
|||
* \param input buffer holding the data
|
||||
* \param ilen length of the input data
|
||||
*/
|
||||
void sha2_hmac_update( sha2_context *ctx, const unsigned char *input, int ilen );
|
||||
void sha2_hmac_update( sha2_context *ctx, const unsigned char *input, size_t ilen );
|
||||
|
||||
/**
|
||||
* \brief SHA-256 HMAC final digest
|
||||
|
|
@ -139,8 +141,8 @@ void sha2_hmac_reset( sha2_context *ctx );
|
|||
* \param output HMAC-SHA-224/256 result
|
||||
* \param is224 0 = use SHA256, 1 = use SHA224
|
||||
*/
|
||||
void sha2_hmac( const unsigned char *key, int keylen,
|
||||
const unsigned char *input, int ilen,
|
||||
void sha2_hmac( const unsigned char *key, size_t keylen,
|
||||
const unsigned char *input, size_t ilen,
|
||||
unsigned char output[32], int is224 );
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue