Fix formatting: fix some 'easy' > 80 length lines
This commit is contained in:
parent
9af723cee7
commit
b9e4e2c97a
60 changed files with 548 additions and 347 deletions
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief AES block cipher
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -82,7 +82,8 @@ aes_context;
|
|||
*
|
||||
* \return 0 if successful, or POLARSSL_ERR_AES_INVALID_KEY_LENGTH
|
||||
*/
|
||||
int aes_setkey_enc( aes_context *ctx, const unsigned char *key, unsigned int keysize );
|
||||
int aes_setkey_enc( aes_context *ctx, const unsigned char *key,
|
||||
unsigned int keysize );
|
||||
|
||||
/**
|
||||
* \brief AES key schedule (decryption)
|
||||
|
@ -93,7 +94,8 @@ int aes_setkey_enc( aes_context *ctx, const unsigned char *key, unsigned int key
|
|||
*
|
||||
* \return 0 if successful, or POLARSSL_ERR_AES_INVALID_KEY_LENGTH
|
||||
*/
|
||||
int aes_setkey_dec( aes_context *ctx, const unsigned char *key, unsigned int keysize );
|
||||
int aes_setkey_dec( aes_context *ctx, const unsigned char *key,
|
||||
unsigned int keysize );
|
||||
|
||||
/**
|
||||
* \brief AES-ECB block encryption/decryption
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief The ARCFOUR stream cipher
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -61,7 +61,8 @@ arc4_context;
|
|||
* \param key the secret key
|
||||
* \param keylen length of the key, in bytes
|
||||
*/
|
||||
void arc4_setup( arc4_context *ctx, const unsigned char *key, unsigned int keylen );
|
||||
void arc4_setup( arc4_context *ctx, const unsigned char *key,
|
||||
unsigned int keylen );
|
||||
|
||||
/**
|
||||
* \brief ARC4 cipher function
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief ASN.1 buffer writing functionality
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -29,7 +29,8 @@
|
|||
|
||||
#include "asn1.h"
|
||||
|
||||
#define ASN1_CHK_ADD(g, f) do { if( ( ret = f ) < 0 ) return( ret ); else g += ret; } while( 0 )
|
||||
#define ASN1_CHK_ADD(g, f) do { if( ( ret = f ) < 0 ) return( ret ); else \
|
||||
g += ret; } while( 0 )
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -57,7 +58,8 @@ int asn1_write_len( unsigned char **p, unsigned char *start, size_t len );
|
|||
*
|
||||
* \return the length written or a negative error code
|
||||
*/
|
||||
int asn1_write_tag( unsigned char **p, unsigned char *start, unsigned char tag );
|
||||
int asn1_write_tag( unsigned char **p, unsigned char *start,
|
||||
unsigned char tag );
|
||||
|
||||
/**
|
||||
* \brief Write raw buffer data
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief Multi-precision integer library
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -652,8 +652,8 @@ int mpi_mod_int( t_uint *r, const mpi *A, t_sint b );
|
|||
*
|
||||
* \return 0 if successful,
|
||||
* POLARSSL_ERR_MPI_MALLOC_FAILED if memory allocation failed,
|
||||
* POLARSSL_ERR_MPI_BAD_INPUT_DATA if N is negative or even or if
|
||||
* E is negative
|
||||
* POLARSSL_ERR_MPI_BAD_INPUT_DATA if N is negative or even or
|
||||
* if E is negative
|
||||
*
|
||||
* \note _RR is used to avoid re-computing R*R mod N across
|
||||
* multiple calls, which speeds up things a bit. It can
|
||||
|
@ -721,7 +721,8 @@ int mpi_is_prime( mpi *X,
|
|||
* \brief Prime number generation
|
||||
*
|
||||
* \param X Destination MPI
|
||||
* \param nbits Required size of X in bits ( 3 <= nbits <= POLARSSL_MPI_MAX_BITS )
|
||||
* \param nbits Required size of X in bits
|
||||
* ( 3 <= nbits <= POLARSSL_MPI_MAX_BITS )
|
||||
* \param dh_flag If 1, then (X-1)/2 will be prime too
|
||||
* \param f_rng RNG function
|
||||
* \param p_rng RNG parameter
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief Blowfish block cipher
|
||||
*
|
||||
* Copyright (C) 2012-2013, Brainspark B.V.
|
||||
* Copyright (C) 2012-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -46,7 +46,7 @@ typedef UINT32 uint32_t;
|
|||
#define BLOWFISH_DECRYPT 0
|
||||
#define BLOWFISH_MAX_KEY 448
|
||||
#define BLOWFISH_MIN_KEY 32
|
||||
#define BLOWFISH_ROUNDS 16 /* when increasing this value, make sure to extend the initialisation vectors */
|
||||
#define BLOWFISH_ROUNDS 16 /**< Rounds to use. When increasing this value, make sure to extend the initialisation vectors */
|
||||
#define BLOWFISH_BLOCKSIZE 8 /* Blowfish uses 64 bit blocks */
|
||||
|
||||
#define POLARSSL_ERR_BLOWFISH_INVALID_KEY_LENGTH -0x0016 /**< Invalid key length. */
|
||||
|
@ -79,7 +79,8 @@ blowfish_context;
|
|||
*
|
||||
* \return 0 if successful, or POLARSSL_ERR_BLOWFISH_INVALID_KEY_LENGTH
|
||||
*/
|
||||
int blowfish_setkey( blowfish_context *ctx, const unsigned char *key, unsigned int keysize );
|
||||
int blowfish_setkey( blowfish_context *ctx, const unsigned char *key,
|
||||
unsigned int keysize );
|
||||
|
||||
/**
|
||||
* \brief Blowfish-ECB block encryption/decryption
|
||||
|
@ -109,7 +110,8 @@ int blowfish_crypt_ecb( blowfish_context *ctx,
|
|||
* \param input buffer holding the input data
|
||||
* \param output buffer holding the output data
|
||||
*
|
||||
* \return 0 if successful, or POLARSSL_ERR_BLOWFISH_INVALID_INPUT_LENGTH
|
||||
* \return 0 if successful, or
|
||||
* POLARSSL_ERR_BLOWFISH_INVALID_INPUT_LENGTH
|
||||
*/
|
||||
int blowfish_crypt_cbc( blowfish_context *ctx,
|
||||
int mode,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief Camellia block cipher
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -75,7 +75,8 @@ camellia_context;
|
|||
*
|
||||
* \return 0 if successful, or POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH
|
||||
*/
|
||||
int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key, unsigned int keysize );
|
||||
int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key,
|
||||
unsigned int keysize );
|
||||
|
||||
/**
|
||||
* \brief CAMELLIA key schedule (decryption)
|
||||
|
@ -86,7 +87,8 @@ int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key, unsign
|
|||
*
|
||||
* \return 0 if successful, or POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH
|
||||
*/
|
||||
int camellia_setkey_dec( camellia_context *ctx, const unsigned char *key, unsigned int keysize );
|
||||
int camellia_setkey_dec( camellia_context *ctx, const unsigned char *key,
|
||||
unsigned int keysize );
|
||||
|
||||
/**
|
||||
* \brief CAMELLIA-ECB block encryption/decryption
|
||||
|
@ -116,7 +118,8 @@ int camellia_crypt_ecb( camellia_context *ctx,
|
|||
* \param input buffer holding the input data
|
||||
* \param output buffer holding the output data
|
||||
*
|
||||
* \return 0 if successful, or POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH
|
||||
* \return 0 if successful, or
|
||||
* POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH
|
||||
*/
|
||||
int camellia_crypt_cbc( camellia_context *ctx,
|
||||
int mode,
|
||||
|
@ -142,7 +145,8 @@ int camellia_crypt_cbc( camellia_context *ctx,
|
|||
* \param input buffer holding the input data
|
||||
* \param output buffer holding the output data
|
||||
*
|
||||
* \return 0 if successful, or POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH
|
||||
* \return 0 if successful, or
|
||||
* POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH
|
||||
*/
|
||||
int camellia_crypt_cfb128( camellia_context *ctx,
|
||||
int mode,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*
|
||||
* \author Adriaan de Jong <dejong@fox-it.com>
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -173,29 +173,34 @@ typedef struct {
|
|||
|
||||
/** Encrypt using ECB */
|
||||
int (*ecb_func)( void *ctx, operation_t mode,
|
||||
const unsigned char *input, unsigned char *output );
|
||||
const unsigned char *input, unsigned char *output );
|
||||
|
||||
/** Encrypt using CBC */
|
||||
int (*cbc_func)( void *ctx, operation_t mode, size_t length, unsigned char *iv,
|
||||
const unsigned char *input, unsigned char *output );
|
||||
int (*cbc_func)( void *ctx, operation_t mode, size_t length,
|
||||
unsigned char *iv, const unsigned char *input,
|
||||
unsigned char *output );
|
||||
|
||||
/** Encrypt using CFB (Full length) */
|
||||
int (*cfb_func)( void *ctx, operation_t mode, size_t length, size_t *iv_off,
|
||||
unsigned char *iv, const unsigned char *input, unsigned char *output );
|
||||
unsigned char *iv, const unsigned char *input,
|
||||
unsigned char *output );
|
||||
|
||||
/** Encrypt using CTR */
|
||||
int (*ctr_func)( void *ctx, size_t length, size_t *nc_off, unsigned char *nonce_counter,
|
||||
unsigned char *stream_block, const unsigned char *input, unsigned char *output );
|
||||
int (*ctr_func)( void *ctx, size_t length, size_t *nc_off,
|
||||
unsigned char *nonce_counter, unsigned char *stream_block,
|
||||
const unsigned char *input, unsigned char *output );
|
||||
|
||||
/** Encrypt using STREAM */
|
||||
int (*stream_func)( void *ctx, size_t length,
|
||||
const unsigned char *input, unsigned char *output );
|
||||
|
||||
/** Set key for encryption purposes */
|
||||
int (*setkey_enc_func)( void *ctx, const unsigned char *key, unsigned int key_length);
|
||||
int (*setkey_enc_func)( void *ctx, const unsigned char *key,
|
||||
unsigned int key_length );
|
||||
|
||||
/** Set key for decryption purposes */
|
||||
int (*setkey_dec_func)( void *ctx, const unsigned char *key, unsigned int key_length);
|
||||
int (*setkey_dec_func)( void *ctx, const unsigned char *key,
|
||||
unsigned int key_length);
|
||||
|
||||
/** Allocate a new context */
|
||||
void * (*ctx_alloc_func)( void );
|
||||
|
@ -323,9 +328,9 @@ const cipher_info_t *cipher_info_from_values( const cipher_id_t cipher_id,
|
|||
* \param ctx context to initialise. May not be NULL.
|
||||
* \param cipher_info cipher to use.
|
||||
*
|
||||
* \return \c 0 on success,
|
||||
* \c POLARSSL_ERR_CIPHER_BAD_INPUT_DATA on parameter failure,
|
||||
* \c POLARSSL_ERR_CIPHER_ALLOC_FAILED if allocation of the
|
||||
* \return 0 on success,
|
||||
* POLARSSL_ERR_CIPHER_BAD_INPUT_DATA on parameter failure,
|
||||
* POLARSSL_ERR_CIPHER_ALLOC_FAILED if allocation of the
|
||||
* cipher-specific context failed.
|
||||
*/
|
||||
int cipher_init_ctx( cipher_context_t *ctx, const cipher_info_t *cipher_info );
|
||||
|
@ -474,8 +479,8 @@ static inline operation_t cipher_get_operation( const cipher_context_t *ctx )
|
|||
* parameter verification fails or a cipher specific
|
||||
* error code.
|
||||
*/
|
||||
int cipher_setkey( cipher_context_t *ctx, const unsigned char *key, int key_length,
|
||||
const operation_t operation );
|
||||
int cipher_setkey( cipher_context_t *ctx, const unsigned char *key,
|
||||
int key_length, const operation_t operation );
|
||||
|
||||
#if defined(POLARSSL_CIPHER_MODE_WITH_PADDING)
|
||||
/**
|
||||
|
@ -568,8 +573,8 @@ int cipher_update_ad( cipher_context_t *ctx,
|
|||
* function, except the last one before cipher_finish(),
|
||||
* must have ilen a multiple of the block size.
|
||||
*/
|
||||
int cipher_update( cipher_context_t *ctx, const unsigned char *input, size_t ilen,
|
||||
unsigned char *output, size_t *olen );
|
||||
int cipher_update( cipher_context_t *ctx, const unsigned char *input,
|
||||
size_t ilen, unsigned char *output, size_t *olen );
|
||||
|
||||
/**
|
||||
* \brief Generic cipher finalisation function. If data still
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief CTR_DRBG based on AES-256 (NIST SP 800-90)
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -91,8 +91,9 @@ typedef struct
|
|||
unsigned char counter[16]; /*!< counter (V) */
|
||||
int reseed_counter; /*!< reseed counter */
|
||||
int prediction_resistance; /*!< enable prediction resistance (Automatic
|
||||
reseed before every random generation) */
|
||||
size_t entropy_len; /*!< amount of entropy grabbed on each (re)seed */
|
||||
reseed before every random generation) */
|
||||
size_t entropy_len; /*!< amount of entropy grabbed on each
|
||||
(re)seed */
|
||||
int reseed_interval; /*!< reseed interval */
|
||||
|
||||
aes_context aes_ctx; /*!< AES context */
|
||||
|
@ -255,7 +256,9 @@ int ctr_drbg_update_seed_file( ctr_drbg_context *ctx, const char *path );
|
|||
int ctr_drbg_self_test( int verbose );
|
||||
|
||||
/* Internal functions (do not call directly) */
|
||||
int ctr_drbg_init_entropy_len( ctr_drbg_context *, int (*)(void *, unsigned char *, size_t), void *, const unsigned char *, size_t, size_t );
|
||||
int ctr_drbg_init_entropy_len( ctr_drbg_context *,
|
||||
int (*)(void *, unsigned char *, size_t), void *,
|
||||
const unsigned char *, size_t, size_t );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief DES block cipher
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -136,7 +136,8 @@ int des_setkey_dec( des_context *ctx, const unsigned char key[DES_KEY_SIZE] );
|
|||
*
|
||||
* \return 0
|
||||
*/
|
||||
int des3_set2key_enc( des3_context *ctx, const unsigned char key[DES_KEY_SIZE * 2] );
|
||||
int des3_set2key_enc( des3_context *ctx,
|
||||
const unsigned char key[DES_KEY_SIZE * 2] );
|
||||
|
||||
/**
|
||||
* \brief Triple-DES key schedule (112-bit, decryption)
|
||||
|
@ -146,7 +147,8 @@ int des3_set2key_enc( des3_context *ctx, const unsigned char key[DES_KEY_SIZE *
|
|||
*
|
||||
* \return 0
|
||||
*/
|
||||
int des3_set2key_dec( des3_context *ctx, const unsigned char key[DES_KEY_SIZE * 2] );
|
||||
int des3_set2key_dec( des3_context *ctx,
|
||||
const unsigned char key[DES_KEY_SIZE * 2] );
|
||||
|
||||
/**
|
||||
* \brief Triple-DES key schedule (168-bit, encryption)
|
||||
|
@ -156,7 +158,8 @@ int des3_set2key_dec( des3_context *ctx, const unsigned char key[DES_KEY_SIZE *
|
|||
*
|
||||
* \return 0
|
||||
*/
|
||||
int des3_set3key_enc( des3_context *ctx, const unsigned char key[DES_KEY_SIZE * 3] );
|
||||
int des3_set3key_enc( des3_context *ctx,
|
||||
const unsigned char key[DES_KEY_SIZE * 3] );
|
||||
|
||||
/**
|
||||
* \brief Triple-DES key schedule (168-bit, decryption)
|
||||
|
@ -166,7 +169,8 @@ int des3_set3key_enc( des3_context *ctx, const unsigned char key[DES_KEY_SIZE *
|
|||
*
|
||||
* \return 0
|
||||
*/
|
||||
int des3_set3key_dec( des3_context *ctx, const unsigned char key[DES_KEY_SIZE * 3] );
|
||||
int des3_set3key_dec( des3_context *ctx,
|
||||
const unsigned char key[DES_KEY_SIZE * 3] );
|
||||
|
||||
/**
|
||||
* \brief DES-ECB block encryption/decryption
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief Entropy accumulator implementation
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -177,7 +177,8 @@ int entropy_add_source( entropy_context *ctx,
|
|||
int entropy_gather( entropy_context *ctx );
|
||||
|
||||
/**
|
||||
* \brief Retrieve entropy from the accumulator (Max ENTROPY_BLOCK_SIZE)
|
||||
* \brief Retrieve entropy from the accumulator
|
||||
* (Maximum length: ENTROPY_BLOCK_SIZE)
|
||||
* (Thread-safe if POLARSSL_THREADING_C is enabled)
|
||||
*
|
||||
* \param data Entropy context
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*
|
||||
* \author Adriaan de Jong <dejong@fox-it.com>
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -92,16 +92,18 @@ typedef struct {
|
|||
|
||||
/** Generic digest function */
|
||||
void (*digest_func)( const unsigned char *input, size_t ilen,
|
||||
unsigned char *output );
|
||||
unsigned char *output );
|
||||
|
||||
/** Generic file digest function */
|
||||
int (*file_func)( const char *path, unsigned char *output );
|
||||
|
||||
/** HMAC Initialisation function */
|
||||
void (*hmac_starts_func)( void *ctx, const unsigned char *key, size_t keylen );
|
||||
void (*hmac_starts_func)( void *ctx, const unsigned char *key,
|
||||
size_t keylen );
|
||||
|
||||
/** HMAC update function */
|
||||
void (*hmac_update_func)( void *ctx, const unsigned char *input, size_t ilen );
|
||||
void (*hmac_update_func)( void *ctx, const unsigned char *input,
|
||||
size_t ilen );
|
||||
|
||||
/** HMAC finalisation function */
|
||||
void (*hmac_finish_func)( void *ctx, unsigned char *output);
|
||||
|
@ -111,8 +113,8 @@ typedef struct {
|
|||
|
||||
/** Generic HMAC function */
|
||||
void (*hmac_func)( const unsigned char *key, size_t keylen,
|
||||
const unsigned char *input, size_t ilen,
|
||||
unsigned char *output );
|
||||
const unsigned char *input, size_t ilen,
|
||||
unsigned char *output );
|
||||
|
||||
/** Allocate a new context */
|
||||
void * (*ctx_alloc_func)( void );
|
||||
|
@ -171,8 +173,8 @@ const md_info_t *md_info_from_string( const char *md_name );
|
|||
const md_info_t *md_info_from_type( md_type_t md_type );
|
||||
|
||||
/**
|
||||
* \brief Initialises and fills the message digest context structure with
|
||||
* the appropriate values.
|
||||
* \brief Initialises and fills the message digest context structure
|
||||
* with the appropriate values.
|
||||
*
|
||||
* \param ctx context to initialise. May not be NULL. The
|
||||
* digest-specific context (ctx->md_ctx) must be NULL. It will
|
||||
|
@ -299,7 +301,8 @@ int md( const md_info_t *md_info, const unsigned char *input, size_t ilen,
|
|||
* failed, POLARSSL_ERR_MD_FILE_READ_FAILED if fread failed,
|
||||
* POLARSSL_ERR_MD_BAD_INPUT_DATA if md_info was NULL.
|
||||
*/
|
||||
int md_file( const md_info_t *md_info, const char *path, unsigned char *output );
|
||||
int md_file( const md_info_t *md_info, const char *path,
|
||||
unsigned char *output );
|
||||
|
||||
/**
|
||||
* \brief Generic HMAC context setup
|
||||
|
@ -311,7 +314,8 @@ int md_file( const md_info_t *md_info, const char *path, unsigned char *output )
|
|||
* \returns 0 on success, POLARSSL_ERR_MD_BAD_INPUT_DATA if parameter
|
||||
* verification fails.
|
||||
*/
|
||||
int md_hmac_starts( md_context_t *ctx, const unsigned char *key, size_t keylen );
|
||||
int md_hmac_starts( md_context_t *ctx, const unsigned char *key,
|
||||
size_t keylen );
|
||||
|
||||
/**
|
||||
* \brief Generic HMAC process buffer
|
||||
|
@ -323,7 +327,8 @@ int md_hmac_starts( md_context_t *ctx, const unsigned char *key, size_t keylen )
|
|||
* \returns 0 on success, POLARSSL_ERR_MD_BAD_INPUT_DATA if parameter
|
||||
* verification fails.
|
||||
*/
|
||||
int md_hmac_update( md_context_t *ctx, const unsigned char *input, size_t ilen );
|
||||
int md_hmac_update( md_context_t *ctx, const unsigned char *input,
|
||||
size_t ilen );
|
||||
|
||||
/**
|
||||
* \brief Generic HMAC final digest
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief MD2 message digest algorithm (hash function)
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -122,7 +122,8 @@ int md2_file( const char *path, unsigned char output[16] );
|
|||
* \param key HMAC secret key
|
||||
* \param keylen length of the HMAC key
|
||||
*/
|
||||
void md2_hmac_starts( md2_context *ctx, const unsigned char *key, size_t keylen );
|
||||
void md2_hmac_starts( md2_context *ctx, const unsigned char *key,
|
||||
size_t keylen );
|
||||
|
||||
/**
|
||||
* \brief MD2 HMAC process buffer
|
||||
|
@ -131,7 +132,8 @@ void md2_hmac_starts( md2_context *ctx, const unsigned char *key, size_t keylen
|
|||
* \param input buffer holding the data
|
||||
* \param ilen length of the input data
|
||||
*/
|
||||
void md2_hmac_update( md2_context *ctx, const unsigned char *input, size_t ilen );
|
||||
void md2_hmac_update( md2_context *ctx, const unsigned char *input,
|
||||
size_t ilen );
|
||||
|
||||
/**
|
||||
* \brief MD2 HMAC final digest
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief MD4 message digest algorithm (hash function)
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -128,7 +128,8 @@ int md4_file( const char *path, unsigned char output[16] );
|
|||
* \param key HMAC secret key
|
||||
* \param keylen length of the HMAC key
|
||||
*/
|
||||
void md4_hmac_starts( md4_context *ctx, const unsigned char *key, size_t keylen );
|
||||
void md4_hmac_starts( md4_context *ctx, const unsigned char *key,
|
||||
size_t keylen );
|
||||
|
||||
/**
|
||||
* \brief MD4 HMAC process buffer
|
||||
|
@ -137,7 +138,8 @@ void md4_hmac_starts( md4_context *ctx, const unsigned char *key, size_t keylen
|
|||
* \param input buffer holding the data
|
||||
* \param ilen length of the input data
|
||||
*/
|
||||
void md4_hmac_update( md4_context *ctx, const unsigned char *input, size_t ilen );
|
||||
void md4_hmac_update( md4_context *ctx, const unsigned char *input,
|
||||
size_t ilen );
|
||||
|
||||
/**
|
||||
* \brief MD4 HMAC final digest
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief Object Identifier (OID) database
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -63,7 +63,7 @@
|
|||
*/
|
||||
#define OID_COUNTRY_US "\x86\x48" /* {us(840)} */
|
||||
#define OID_ORG_RSA_DATA_SECURITY "\x86\xf7\x0d" /* {rsadsi(113549)} */
|
||||
#define OID_RSA_COMPANY OID_ISO_MEMBER_BODIES OID_COUNTRY_US \
|
||||
#define OID_RSA_COMPANY OID_ISO_MEMBER_BODIES OID_COUNTRY_US \
|
||||
OID_ORG_RSA_DATA_SECURITY /* {iso(1) member-body(2) us(840) rsadsi(113549)} */
|
||||
#define OID_ORG_ANSI_X9_62 "\xce\x3d" /* ansi-X9-62(10045) */
|
||||
#define OID_ANSI_X9_62 OID_ISO_MEMBER_BODIES OID_COUNTRY_US \
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/**
|
||||
* \file padlock.h
|
||||
*
|
||||
* \brief VIA PadLock ACE for HW encryption/decryption supported by some processors
|
||||
* \brief VIA PadLock ACE for HW encryption/decryption supported by some
|
||||
* processors
|
||||
*
|
||||
* Copyright (C) 2006-2010, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*
|
||||
* \author Adriaan de Jong <dejong@fox-it.com>
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -93,7 +93,8 @@ int pkcs11_priv_key_init( pkcs11_context *priv_key,
|
|||
void pkcs11_priv_key_free( pkcs11_context *priv_key );
|
||||
|
||||
/**
|
||||
* \brief Do an RSA private key decrypt, then remove the message padding
|
||||
* \brief Do an RSA private key decrypt, then remove the message
|
||||
* padding
|
||||
*
|
||||
* \param ctx PKCS #11 context
|
||||
* \param mode must be RSA_PRIVATE, for compatibility with rsa.c's signature
|
||||
|
@ -119,8 +120,8 @@ int pkcs11_decrypt( pkcs11_context *ctx,
|
|||
*
|
||||
* \param ctx PKCS #11 context
|
||||
* \param mode must be RSA_PRIVATE, for compatibility with rsa.c's signature
|
||||
* \param hash_id SIG_RSA_RAW, SIG_RSA_MD{2,4,5} or SIG_RSA_SHA{1,224,256,384,512}
|
||||
* \param hashlen message digest length (for SIG_RSA_RAW only)
|
||||
* \param md_alg a POLARSSL_MD_* (use POLARSSL_MD_NONE for signing raw data)
|
||||
* \param hashlen message digest length (for POLARSSL_MD_NONE only)
|
||||
* \param hash buffer holding the message digest
|
||||
* \param sig buffer that will hold the ciphertext
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief The RSA public-key cryptosystem
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -503,8 +503,8 @@ int rsa_rsassa_pss_sign( rsa_context *ctx,
|
|||
*
|
||||
* \note In case of PKCS#1 v2.1 encoding keep in mind that
|
||||
* the hash_id in the RSA context is the one used for the
|
||||
* verification. hash_id in the function call is the type of hash
|
||||
* that is verified. According to RFC 3447 it is advised to
|
||||
* verification. hash_id in the function call is the type of
|
||||
* hash that is verified. According to RFC 3447 it is advised to
|
||||
* keep both hashes the same.
|
||||
*/
|
||||
int rsa_pkcs1_verify( rsa_context *ctx,
|
||||
|
@ -563,8 +563,8 @@ int rsa_rsassa_pkcs1_v15_verify( rsa_context *ctx,
|
|||
*
|
||||
* \note In case of PKCS#1 v2.1 encoding keep in mind that
|
||||
* the hash_id in the RSA context is the one used for the
|
||||
* verification. hash_id in the function call is the type of hash
|
||||
* that is verified. According to RFC 3447 it is advised to
|
||||
* verification. hash_id in the function call is the type of
|
||||
* hash that is verified. According to RFC 3447 it is advised to
|
||||
* keep both hashes the same.
|
||||
*/
|
||||
int rsa_rsassa_pss_verify( rsa_context *ctx,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief SHA-1 cryptographic hash function
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -131,7 +131,8 @@ int sha1_file( const char *path, unsigned char output[20] );
|
|||
* \param key HMAC secret key
|
||||
* \param keylen length of the HMAC key
|
||||
*/
|
||||
void sha1_hmac_starts( sha1_context *ctx, const unsigned char *key, size_t keylen );
|
||||
void sha1_hmac_starts( sha1_context *ctx, const unsigned char *key,
|
||||
size_t keylen );
|
||||
|
||||
/**
|
||||
* \brief SHA-1 HMAC process buffer
|
||||
|
@ -140,7 +141,8 @@ void sha1_hmac_starts( sha1_context *ctx, const unsigned char *key, size_t keyle
|
|||
* \param input buffer holding the data
|
||||
* \param ilen length of the input data
|
||||
*/
|
||||
void sha1_hmac_update( sha1_context *ctx, const unsigned char *input, size_t ilen );
|
||||
void sha1_hmac_update( sha1_context *ctx, const unsigned char *input,
|
||||
size_t ilen );
|
||||
|
||||
/**
|
||||
* \brief SHA-1 HMAC final digest
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief SHA-224 and SHA-256 cryptographic hash function
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -82,7 +82,8 @@ void sha256_starts( sha256_context *ctx, int is224 );
|
|||
* \param input buffer holding the data
|
||||
* \param ilen length of the input data
|
||||
*/
|
||||
void sha256_update( sha256_context *ctx, const unsigned char *input, size_t ilen );
|
||||
void sha256_update( sha256_context *ctx, const unsigned char *input,
|
||||
size_t ilen );
|
||||
|
||||
/**
|
||||
* \brief SHA-256 final digest
|
||||
|
@ -147,7 +148,8 @@ void sha256_hmac_starts( sha256_context *ctx, const unsigned char *key,
|
|||
* \param input buffer holding the data
|
||||
* \param ilen length of the input data
|
||||
*/
|
||||
void sha256_hmac_update( sha256_context *ctx, const unsigned char *input, size_t ilen );
|
||||
void sha256_hmac_update( sha256_context *ctx, const unsigned char *input,
|
||||
size_t ilen );
|
||||
|
||||
/**
|
||||
* \brief SHA-256 HMAC final digest
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief SHA-384 and SHA-512 cryptographic hash function
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -83,7 +83,8 @@ void sha512_starts( sha512_context *ctx, int is384 );
|
|||
* \param input buffer holding the data
|
||||
* \param ilen length of the input data
|
||||
*/
|
||||
void sha512_update( sha512_context *ctx, const unsigned char *input, size_t ilen );
|
||||
void sha512_update( sha512_context *ctx, const unsigned char *input,
|
||||
size_t ilen );
|
||||
|
||||
/**
|
||||
* \brief SHA-512 final digest
|
||||
|
@ -145,7 +146,8 @@ void sha512_hmac_starts( sha512_context *ctx, const unsigned char *key,
|
|||
* \param input buffer holding the data
|
||||
* \param ilen length of the input data
|
||||
*/
|
||||
void sha512_hmac_update( sha512_context *ctx, const unsigned char *input, size_t ilen );
|
||||
void sha512_hmac_update( sha512_context *ctx, const unsigned char *input,
|
||||
size_t ilen );
|
||||
|
||||
/**
|
||||
* \brief SHA-512 HMAC final digest
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief SSL/TLS functions.
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -825,8 +825,8 @@ extern int (*ssl_hw_record_finish)(ssl_context *ssl);
|
|||
const int *ssl_list_ciphersuites( void );
|
||||
|
||||
/**
|
||||
* \brief Return the name of the ciphersuite associated with the given
|
||||
* ID
|
||||
* \brief Return the name of the ciphersuite associated with the
|
||||
* given ID
|
||||
*
|
||||
* \param ciphersuite_id SSL ciphersuite ID
|
||||
*
|
||||
|
@ -835,8 +835,8 @@ const int *ssl_list_ciphersuites( void );
|
|||
const char *ssl_get_ciphersuite_name( const int ciphersuite_id );
|
||||
|
||||
/**
|
||||
* \brief Return the ID of the ciphersuite associated with the given
|
||||
* name
|
||||
* \brief Return the ID of the ciphersuite associated with the
|
||||
* given name
|
||||
*
|
||||
* \param ciphersuite_name SSL ciphersuite name
|
||||
*
|
||||
|
@ -1642,7 +1642,8 @@ int ssl_write_change_cipher_spec( ssl_context *ssl );
|
|||
int ssl_parse_finished( ssl_context *ssl );
|
||||
int ssl_write_finished( ssl_context *ssl );
|
||||
|
||||
void ssl_optimize_checksum( ssl_context *ssl, const ssl_ciphersuite_t *ciphersuite_info );
|
||||
void ssl_optimize_checksum( ssl_context *ssl,
|
||||
const ssl_ciphersuite_t *ciphersuite_info );
|
||||
|
||||
#if defined(POLARSSL_KEY_EXCHANGE__SOME__PSK_ENABLED)
|
||||
int ssl_psk_derive_premaster( ssl_context *ssl, key_exchange_type_t key_ex );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief X.509 generic defines and structures
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -288,7 +288,9 @@ int x509_get_ext( unsigned char **p, const unsigned char *end,
|
|||
int x509_load_file( const char *path, unsigned char **buf, size_t *n );
|
||||
int x509_key_size_helper( char *buf, size_t size, const char *name );
|
||||
int x509_string_to_names( asn1_named_data **head, const char *name );
|
||||
int x509_set_extension( asn1_named_data **head, const char *oid, size_t oid_len, int critical, const unsigned char *val, size_t val_len );
|
||||
int x509_set_extension( asn1_named_data **head, const char *oid, size_t oid_len,
|
||||
int critical, const unsigned char *val,
|
||||
size_t val_len );
|
||||
int x509_write_extensions( unsigned char **p, unsigned char *start,
|
||||
asn1_named_data *first );
|
||||
int x509_write_names( unsigned char **p, unsigned char *start,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* \brief X.509 certificate signing request parsing and writing
|
||||
*
|
||||
* Copyright (C) 2006-2013, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
|
@ -204,7 +204,8 @@ int x509write_csr_set_ns_cert_type( x509write_csr *ctx,
|
|||
unsigned char ns_cert_type );
|
||||
|
||||
/**
|
||||
* \brief Generic function to add to or replace an extension in the CSR
|
||||
* \brief Generic function to add to or replace an extension in the
|
||||
* CSR
|
||||
*
|
||||
* \param ctx CSR context to use
|
||||
* \param oid OID of the extension
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue