pk_wrap.c File Reference

#include "polarssl/config.h"
#include "polarssl/pk_wrap.h"
#include "polarssl/rsa.h"
#include "polarssl/ecp.h"
#include "polarssl/ecdsa.h"
#include <stdlib.h>
Include dependency graph for pk_wrap.c:

Go to the source code of this file.

Defines

#define polarssl_malloc   malloc
#define polarssl_free   free

Functions

static int rsa_can_do (pk_type_t type)
static size_t rsa_get_size (const void *ctx)
static int rsa_verify_wrap (void *ctx, md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
static int rsa_sign_wrap (void *ctx, md_type_t md_alg, const unsigned char *hash, size_t hash_len, unsigned char *sig, size_t *sig_len, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
static int rsa_decrypt_wrap (void *ctx, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen, size_t osize, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
static int rsa_encrypt_wrap (void *ctx, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen, size_t osize, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
static void * rsa_alloc_wrap (void)
static void rsa_free_wrap (void *ctx)
static void rsa_debug (const void *ctx, pk_debug_item *items)
static int eckey_can_do (pk_type_t type)
static size_t eckey_get_size (const void *ctx)
static int ecdsa_verify_wrap (void *ctx, md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
static int ecdsa_sign_wrap (void *ctx, md_type_t md_alg, const unsigned char *hash, size_t hash_len, unsigned char *sig, size_t *sig_len, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
static int eckey_verify_wrap (void *ctx, md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
static int eckey_sign_wrap (void *ctx, md_type_t md_alg, const unsigned char *hash, size_t hash_len, unsigned char *sig, size_t *sig_len, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
static void * eckey_alloc_wrap (void)
static void eckey_free_wrap (void *ctx)
static void eckey_debug (const void *ctx, pk_debug_item *items)
static int eckeydh_can_do (pk_type_t type)
static int ecdsa_can_do (pk_type_t type)
static void * ecdsa_alloc_wrap (void)
static void ecdsa_free_wrap (void *ctx)
static size_t rsa_alt_get_size (const void *ctx)
static int rsa_alt_sign_wrap (void *ctx, md_type_t md_alg, const unsigned char *hash, size_t hash_len, unsigned char *sig, size_t *sig_len, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
static int rsa_alt_decrypt_wrap (void *ctx, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen, size_t osize, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
static void * rsa_alt_alloc_wrap (void)
static void rsa_alt_free_wrap (void *ctx)

Variables

const pk_info_t rsa_info
const pk_info_t eckey_info
const pk_info_t eckeydh_info
const pk_info_t ecdsa_info
const pk_info_t rsa_alt_info

Define Documentation

#define polarssl_free   free

Definition at line 48 of file pk_wrap.c.

#define polarssl_malloc   malloc

Definition at line 47 of file pk_wrap.c.


Function Documentation

static void* ecdsa_alloc_wrap ( void   )  [static]

Definition at line 312 of file pk_wrap.c.

References ecdsa_init(), and polarssl_malloc.

static int ecdsa_can_do ( pk_type_t  type  )  [static]

Definition at line 286 of file pk_wrap.c.

References POLARSSL_PK_ECDSA.

static void ecdsa_free_wrap ( void *  ctx  )  [static]

Definition at line 322 of file pk_wrap.c.

References ecdsa_free(), and polarssl_free.

static int ecdsa_sign_wrap ( void *  ctx,
md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
unsigned char *  sig,
size_t *  sig_len,
int(*)(void *, unsigned char *, size_t)  f_rng,
void *  p_rng 
) [static]

Definition at line 301 of file pk_wrap.c.

References ecdsa_write_signature().

Referenced by eckey_sign_wrap().

static int ecdsa_verify_wrap ( void *  ctx,
md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
const unsigned char *  sig,
size_t  sig_len 
) [static]

Definition at line 291 of file pk_wrap.c.

References ecdsa_read_signature().

Referenced by eckey_verify_wrap().

static void* eckey_alloc_wrap ( void   )  [static]

Definition at line 219 of file pk_wrap.c.

References ecp_keypair_init(), and polarssl_malloc.

static int eckey_can_do ( pk_type_t  type  )  [static]

Definition at line 158 of file pk_wrap.c.

References POLARSSL_PK_ECDSA, POLARSSL_PK_ECKEY, and POLARSSL_PK_ECKEY_DH.

static void eckey_debug ( const void *  ctx,
pk_debug_item items 
) [static]
static void eckey_free_wrap ( void *  ctx  )  [static]

Definition at line 229 of file pk_wrap.c.

References ecp_keypair_free(), and polarssl_free.

static size_t eckey_get_size ( const void *  ctx  )  [static]

Definition at line 165 of file pk_wrap.c.

static int eckey_sign_wrap ( void *  ctx,
md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
unsigned char *  sig,
size_t *  sig_len,
int(*)(void *, unsigned char *, size_t)  f_rng,
void *  p_rng 
) [static]

Definition at line 198 of file pk_wrap.c.

References ecdsa_free(), ecdsa_from_keypair(), ecdsa_init(), and ecdsa_sign_wrap().

static int eckey_verify_wrap ( void *  ctx,
md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
const unsigned char *  sig,
size_t  sig_len 
) [static]

Definition at line 181 of file pk_wrap.c.

References ecdsa_free(), ecdsa_from_keypair(), ecdsa_init(), and ecdsa_verify_wrap().

static int eckeydh_can_do ( pk_type_t  type  )  [static]

Definition at line 264 of file pk_wrap.c.

References POLARSSL_PK_ECKEY, and POLARSSL_PK_ECKEY_DH.

static void* rsa_alloc_wrap ( void   )  [static]

Definition at line 110 of file pk_wrap.c.

References polarssl_malloc, and rsa_init().

static void* rsa_alt_alloc_wrap ( void   )  [static]

Definition at line 384 of file pk_wrap.c.

References polarssl_malloc.

static int rsa_alt_decrypt_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output,
size_t *  olen,
size_t  osize,
int(*)(void *, unsigned char *, size_t)  f_rng,
void *  p_rng 
) [static]
static void rsa_alt_free_wrap ( void *  ctx  )  [static]

Definition at line 394 of file pk_wrap.c.

References polarssl_free.

static size_t rsa_alt_get_size ( const void *  ctx  )  [static]

Definition at line 347 of file pk_wrap.c.

References rsa_alt_context::key, and rsa_alt_context::key_len_func.

static int rsa_alt_sign_wrap ( void *  ctx,
md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
unsigned char *  sig,
size_t *  sig_len,
int(*)(void *, unsigned char *, size_t)  f_rng,
void *  p_rng 
) [static]
static int rsa_can_do ( pk_type_t  type  )  [static]

Definition at line 52 of file pk_wrap.c.

References POLARSSL_PK_RSA.

static void rsa_debug ( const void *  ctx,
pk_debug_item items 
) [static]
static int rsa_decrypt_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output,
size_t *  olen,
size_t  osize,
int(*)(void *, unsigned char *, size_t)  f_rng,
void *  p_rng 
) [static]

Definition at line 85 of file pk_wrap.c.

References POLARSSL_ERR_RSA_BAD_INPUT_DATA, rsa_pkcs1_decrypt(), and RSA_PRIVATE.

static int rsa_encrypt_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output,
size_t *  olen,
size_t  osize,
int(*)(void *, unsigned char *, size_t)  f_rng,
void *  p_rng 
) [static]

Definition at line 97 of file pk_wrap.c.

References rsa_pkcs1_encrypt(), and RSA_PUBLIC.

static void rsa_free_wrap ( void *  ctx  )  [static]

Definition at line 120 of file pk_wrap.c.

References polarssl_free, and rsa_free().

static size_t rsa_get_size ( const void *  ctx  )  [static]

Definition at line 58 of file pk_wrap.c.

static int rsa_sign_wrap ( void *  ctx,
md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
unsigned char *  sig,
size_t *  sig_len,
int(*)(void *, unsigned char *, size_t)  f_rng,
void *  p_rng 
) [static]

Definition at line 74 of file pk_wrap.c.

References rsa_pkcs1_sign(), and RSA_PRIVATE.

static int rsa_verify_wrap ( void *  ctx,
md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
const unsigned char *  sig,
size_t  sig_len 
) [static]

Definition at line 63 of file pk_wrap.c.

References POLARSSL_ERR_RSA_VERIFY_FAILED, rsa_pkcs1_verify(), and RSA_PUBLIC.


Variable Documentation

Initial value:

Definition at line 328 of file pk_wrap.c.

Referenced by pk_info_from_type().

Initial value:

Definition at line 242 of file pk_wrap.c.

Referenced by pk_info_from_type().

Initial value:

Definition at line 270 of file pk_wrap.c.

Referenced by pk_info_from_type().

Initial value:

Definition at line 399 of file pk_wrap.c.

Referenced by pk_init_ctx_rsa_alt().


Generated on 9 Apr 2014 for PolarSSL v1.3.2 by  doxygen 1.6.1