Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
mbedtls
Commits
b9e4e2c9
Commit
b9e4e2c9
authored
May 01, 2014
by
Paul Bakker
Browse files
Fix formatting: fix some 'easy' > 80 length lines
parent
9af723ce
Changes
60
Hide whitespace changes
Inline
Side-by-side
include/polarssl/aes.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief AES block cipher
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
...
...
include/polarssl/arc4.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief The ARCFOUR stream cipher
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
...
...
include/polarssl/asn1write.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief ASN.1 buffer writing functionality
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
...
...
include/polarssl/bignum.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief Multi-precision integer library
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
...
...
include/polarssl/blowfish.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief Blowfish block cipher
*
* Copyright (C) 2012-201
3
, Brainspark B.V.
* Copyright (C) 2012-201
4
, 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
/*
w
hen increasing this value, make sure to extend the initialisation vectors */
#define BLOWFISH_ROUNDS 16
/*
*< Rounds to use. W
hen 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
,
...
...
include/polarssl/camellia.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief Camellia block cipher
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
,
...
...
include/polarssl/cipher.h
View file @
b9e4e2c9
...
...
@@ -5,7 +5,7 @@
*
* \author Adriaan de Jong <dejong@fox-it.com>
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
...
...
include/polarssl/ctr_drbg.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief CTR_DRBG based on AES-256 (NIST SP 800-90)
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
}
...
...
include/polarssl/des.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief DES block cipher
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
...
...
include/polarssl/entropy.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief Entropy accumulator implementation
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
...
...
include/polarssl/md.h
View file @
b9e4e2c9
...
...
@@ -5,7 +5,7 @@
*
* \author Adriaan de Jong <dejong@fox-it.com>
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
...
...
include/polarssl/md2.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief MD2 message digest algorithm (hash function)
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
...
...
include/polarssl/md4.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief MD4 message digest algorithm (hash function)
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
...
...
include/polarssl/oid.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief Object Identifier (OID) database
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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 \
...
...
include/polarssl/padlock.h
View file @
b9e4e2c9
/**
* \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-201
0
, Brainspark B.V.
* Copyright (C) 2006-201
4
, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
...
...
include/polarssl/pkcs11.h
View file @
b9e4e2c9
...
...
@@ -5,7 +5,7 @@
*
* \author Adriaan de Jong <dejong@fox-it.com>
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
*
...
...
include/polarssl/rsa.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief The RSA public-key cryptosystem
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
,
...
...
include/polarssl/sha1.h
View file @
b9e4e2c9
...
...
@@ -3,7 +3,7 @@
*
* \brief SHA-1 cryptographic hash function
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, 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
);