md_wrap.c File Reference

Generic message digest wrapper for PolarSSL. More...

#include "polarssl/config.h"
#include "polarssl/md_wrap.h"
#include "polarssl/md5.h"
#include "polarssl/sha1.h"
#include "polarssl/sha256.h"
#include "polarssl/sha512.h"
#include <stdlib.h>
Include dependency graph for md_wrap.c:

Go to the source code of this file.

Defines

#define polarssl_malloc   malloc
#define polarssl_free   free

Functions

static void md5_starts_wrap (void *ctx)
static void md5_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void md5_finish_wrap (void *ctx, unsigned char *output)
static int md5_file_wrap (const char *path, unsigned char *output)
static void md5_hmac_starts_wrap (void *ctx, const unsigned char *key, size_t keylen)
static void md5_hmac_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void md5_hmac_finish_wrap (void *ctx, unsigned char *output)
static void md5_hmac_reset_wrap (void *ctx)
static void * md5_ctx_alloc (void)
static void md5_ctx_free (void *ctx)
static void md5_process_wrap (void *ctx, const unsigned char *data)
static void sha1_starts_wrap (void *ctx)
static void sha1_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void sha1_finish_wrap (void *ctx, unsigned char *output)
static int sha1_file_wrap (const char *path, unsigned char *output)
static void sha1_hmac_starts_wrap (void *ctx, const unsigned char *key, size_t keylen)
static void sha1_hmac_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void sha1_hmac_finish_wrap (void *ctx, unsigned char *output)
static void sha1_hmac_reset_wrap (void *ctx)
static void * sha1_ctx_alloc (void)
static void sha1_ctx_free (void *ctx)
static void sha1_process_wrap (void *ctx, const unsigned char *data)
static void sha224_starts_wrap (void *ctx)
static void sha224_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void sha224_finish_wrap (void *ctx, unsigned char *output)
static void sha224_wrap (const unsigned char *input, size_t ilen, unsigned char *output)
static int sha224_file_wrap (const char *path, unsigned char *output)
static void sha224_hmac_starts_wrap (void *ctx, const unsigned char *key, size_t keylen)
static void sha224_hmac_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void sha224_hmac_finish_wrap (void *ctx, unsigned char *output)
static void sha224_hmac_reset_wrap (void *ctx)
static void sha224_hmac_wrap (const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char *output)
static void * sha224_ctx_alloc (void)
static void sha224_ctx_free (void *ctx)
static void sha224_process_wrap (void *ctx, const unsigned char *data)
static void sha256_starts_wrap (void *ctx)
static void sha256_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void sha256_finish_wrap (void *ctx, unsigned char *output)
static void sha256_wrap (const unsigned char *input, size_t ilen, unsigned char *output)
static int sha256_file_wrap (const char *path, unsigned char *output)
static void sha256_hmac_starts_wrap (void *ctx, const unsigned char *key, size_t keylen)
static void sha256_hmac_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void sha256_hmac_finish_wrap (void *ctx, unsigned char *output)
static void sha256_hmac_reset_wrap (void *ctx)
static void sha256_hmac_wrap (const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char *output)
static void * sha256_ctx_alloc (void)
static void sha256_ctx_free (void *ctx)
static void sha256_process_wrap (void *ctx, const unsigned char *data)
static void sha384_starts_wrap (void *ctx)
static void sha384_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void sha384_finish_wrap (void *ctx, unsigned char *output)
static void sha384_wrap (const unsigned char *input, size_t ilen, unsigned char *output)
static int sha384_file_wrap (const char *path, unsigned char *output)
static void sha384_hmac_starts_wrap (void *ctx, const unsigned char *key, size_t keylen)
static void sha384_hmac_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void sha384_hmac_finish_wrap (void *ctx, unsigned char *output)
static void sha384_hmac_reset_wrap (void *ctx)
static void sha384_hmac_wrap (const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char *output)
static void * sha384_ctx_alloc (void)
static void sha384_ctx_free (void *ctx)
static void sha384_process_wrap (void *ctx, const unsigned char *data)
static void sha512_starts_wrap (void *ctx)
static void sha512_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void sha512_finish_wrap (void *ctx, unsigned char *output)
static void sha512_wrap (const unsigned char *input, size_t ilen, unsigned char *output)
static int sha512_file_wrap (const char *path, unsigned char *output)
static void sha512_hmac_starts_wrap (void *ctx, const unsigned char *key, size_t keylen)
static void sha512_hmac_update_wrap (void *ctx, const unsigned char *input, size_t ilen)
static void sha512_hmac_finish_wrap (void *ctx, unsigned char *output)
static void sha512_hmac_reset_wrap (void *ctx)
static void sha512_hmac_wrap (const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char *output)
static void * sha512_ctx_alloc (void)
static void sha512_ctx_free (void *ctx)
static void sha512_process_wrap (void *ctx, const unsigned char *data)

Variables

const md_info_t md5_info
const md_info_t sha1_info
const md_info_t sha224_info
const md_info_t sha256_info
const md_info_t sha384_info
const md_info_t sha512_info

Detailed Description

Generic message digest wrapper for PolarSSL.

Author:
Adriaan de Jong <dejong@fox-it.com>

Copyright (C) 2006-2013, Brainspark B.V.

This file is part of PolarSSL (http://www.polarssl.org) Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>

All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Definition in file md_wrap.c.


Define Documentation

#define polarssl_free   free

Definition at line 64 of file md_wrap.c.

#define polarssl_malloc   malloc

Definition at line 63 of file md_wrap.c.


Function Documentation

static void* md5_ctx_alloc ( void   )  [static]

Definition at line 287 of file md_wrap.c.

References polarssl_malloc.

static void md5_ctx_free ( void *  ctx  )  [static]

Definition at line 292 of file md_wrap.c.

References polarssl_free.

static int md5_file_wrap ( const char *  path,
unsigned char *  output 
) [static]

Definition at line 256 of file md_wrap.c.

References md5_file(), and POLARSSL_ERR_MD_FEATURE_UNAVAILABLE.

static void md5_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 251 of file md_wrap.c.

References md5_finish().

static void md5_hmac_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 277 of file md_wrap.c.

References md5_hmac_finish().

static void md5_hmac_reset_wrap ( void *  ctx  )  [static]

Definition at line 282 of file md_wrap.c.

References md5_hmac_reset().

static void md5_hmac_starts_wrap ( void *  ctx,
const unsigned char *  key,
size_t  keylen 
) [static]

Definition at line 267 of file md_wrap.c.

References md5_hmac_starts().

static void md5_hmac_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 272 of file md_wrap.c.

References md5_hmac_update().

static void md5_process_wrap ( void *  ctx,
const unsigned char *  data 
) [static]

Definition at line 297 of file md_wrap.c.

References md5_process().

static void md5_starts_wrap ( void *  ctx  )  [static]

Definition at line 241 of file md_wrap.c.

References md5_starts().

static void md5_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 246 of file md_wrap.c.

References md5_update().

static void* sha1_ctx_alloc ( void   )  [static]

Definition at line 371 of file md_wrap.c.

References polarssl_malloc.

static void sha1_ctx_free ( void *  ctx  )  [static]

Definition at line 376 of file md_wrap.c.

References polarssl_free.

static int sha1_file_wrap ( const char *  path,
unsigned char *  output 
) [static]

Definition at line 340 of file md_wrap.c.

References POLARSSL_ERR_MD_FEATURE_UNAVAILABLE, and sha1_file().

static void sha1_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 335 of file md_wrap.c.

References sha1_finish().

static void sha1_hmac_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 361 of file md_wrap.c.

References sha1_hmac_finish().

static void sha1_hmac_reset_wrap ( void *  ctx  )  [static]

Definition at line 366 of file md_wrap.c.

References sha1_hmac_reset().

static void sha1_hmac_starts_wrap ( void *  ctx,
const unsigned char *  key,
size_t  keylen 
) [static]

Definition at line 351 of file md_wrap.c.

References sha1_hmac_starts().

static void sha1_hmac_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 356 of file md_wrap.c.

References sha1_hmac_update().

static void sha1_process_wrap ( void *  ctx,
const unsigned char *  data 
) [static]

Definition at line 381 of file md_wrap.c.

References sha1_process().

static void sha1_starts_wrap ( void *  ctx  )  [static]

Definition at line 325 of file md_wrap.c.

References sha1_starts().

static void sha1_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 330 of file md_wrap.c.

References sha1_update().

static void* sha224_ctx_alloc ( void   )  [static]

Definition at line 471 of file md_wrap.c.

References polarssl_malloc.

static void sha224_ctx_free ( void *  ctx  )  [static]

Definition at line 476 of file md_wrap.c.

References polarssl_free.

static int sha224_file_wrap ( const char *  path,
unsigned char *  output 
) [static]

Definition at line 433 of file md_wrap.c.

References POLARSSL_ERR_MD_FEATURE_UNAVAILABLE, and sha256_file().

static void sha224_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 422 of file md_wrap.c.

References sha256_finish().

static void sha224_hmac_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 454 of file md_wrap.c.

References sha256_hmac_finish().

static void sha224_hmac_reset_wrap ( void *  ctx  )  [static]

Definition at line 459 of file md_wrap.c.

References sha256_hmac_reset().

static void sha224_hmac_starts_wrap ( void *  ctx,
const unsigned char *  key,
size_t  keylen 
) [static]

Definition at line 444 of file md_wrap.c.

References sha256_hmac_starts().

static void sha224_hmac_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 449 of file md_wrap.c.

References sha256_hmac_update().

static void sha224_hmac_wrap ( const unsigned char *  key,
size_t  keylen,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output 
) [static]

Definition at line 464 of file md_wrap.c.

References sha256_hmac().

static void sha224_process_wrap ( void *  ctx,
const unsigned char *  data 
) [static]

Definition at line 481 of file md_wrap.c.

References sha256_process().

static void sha224_starts_wrap ( void *  ctx  )  [static]

Definition at line 412 of file md_wrap.c.

References sha256_starts().

static void sha224_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 417 of file md_wrap.c.

References sha256_update().

static void sha224_wrap ( const unsigned char *  input,
size_t  ilen,
unsigned char *  output 
) [static]

Definition at line 427 of file md_wrap.c.

References sha256().

static void* sha256_ctx_alloc ( void   )  [static]

Definition at line 564 of file md_wrap.c.

References polarssl_malloc.

static void sha256_ctx_free ( void *  ctx  )  [static]

Definition at line 569 of file md_wrap.c.

References polarssl_free.

static int sha256_file_wrap ( const char *  path,
unsigned char *  output 
) [static]

Definition at line 526 of file md_wrap.c.

References POLARSSL_ERR_MD_FEATURE_UNAVAILABLE, and sha256_file().

static void sha256_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 515 of file md_wrap.c.

References sha256_finish().

static void sha256_hmac_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 547 of file md_wrap.c.

References sha256_hmac_finish().

static void sha256_hmac_reset_wrap ( void *  ctx  )  [static]

Definition at line 552 of file md_wrap.c.

References sha256_hmac_reset().

static void sha256_hmac_starts_wrap ( void *  ctx,
const unsigned char *  key,
size_t  keylen 
) [static]

Definition at line 537 of file md_wrap.c.

References sha256_hmac_starts().

static void sha256_hmac_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 542 of file md_wrap.c.

References sha256_hmac_update().

static void sha256_hmac_wrap ( const unsigned char *  key,
size_t  keylen,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output 
) [static]

Definition at line 557 of file md_wrap.c.

References sha256_hmac().

static void sha256_process_wrap ( void *  ctx,
const unsigned char *  data 
) [static]

Definition at line 574 of file md_wrap.c.

References sha256_process().

static void sha256_starts_wrap ( void *  ctx  )  [static]

Definition at line 505 of file md_wrap.c.

References sha256_starts().

static void sha256_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 510 of file md_wrap.c.

References sha256_update().

static void sha256_wrap ( const unsigned char *  input,
size_t  ilen,
unsigned char *  output 
) [static]

Definition at line 520 of file md_wrap.c.

References sha256().

static void* sha384_ctx_alloc ( void   )  [static]

Definition at line 661 of file md_wrap.c.

References polarssl_malloc.

static void sha384_ctx_free ( void *  ctx  )  [static]

Definition at line 666 of file md_wrap.c.

References polarssl_free.

static int sha384_file_wrap ( const char *  path,
unsigned char *  output 
) [static]

Definition at line 623 of file md_wrap.c.

References POLARSSL_ERR_MD_FEATURE_UNAVAILABLE, and sha512_file().

static void sha384_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 612 of file md_wrap.c.

References sha512_finish().

static void sha384_hmac_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 644 of file md_wrap.c.

References sha512_hmac_finish().

static void sha384_hmac_reset_wrap ( void *  ctx  )  [static]

Definition at line 649 of file md_wrap.c.

References sha512_hmac_reset().

static void sha384_hmac_starts_wrap ( void *  ctx,
const unsigned char *  key,
size_t  keylen 
) [static]

Definition at line 634 of file md_wrap.c.

References sha512_hmac_starts().

static void sha384_hmac_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 639 of file md_wrap.c.

References sha512_hmac_update().

static void sha384_hmac_wrap ( const unsigned char *  key,
size_t  keylen,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output 
) [static]

Definition at line 654 of file md_wrap.c.

References sha512_hmac().

static void sha384_process_wrap ( void *  ctx,
const unsigned char *  data 
) [static]

Definition at line 671 of file md_wrap.c.

References sha512_process().

static void sha384_starts_wrap ( void *  ctx  )  [static]

Definition at line 602 of file md_wrap.c.

References sha512_starts().

static void sha384_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 607 of file md_wrap.c.

References sha512_update().

static void sha384_wrap ( const unsigned char *  input,
size_t  ilen,
unsigned char *  output 
) [static]

Definition at line 617 of file md_wrap.c.

References sha512().

static void* sha512_ctx_alloc ( void   )  [static]

Definition at line 754 of file md_wrap.c.

References polarssl_malloc.

static void sha512_ctx_free ( void *  ctx  )  [static]

Definition at line 759 of file md_wrap.c.

References polarssl_free.

static int sha512_file_wrap ( const char *  path,
unsigned char *  output 
) [static]

Definition at line 716 of file md_wrap.c.

References POLARSSL_ERR_MD_FEATURE_UNAVAILABLE, and sha512_file().

static void sha512_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 705 of file md_wrap.c.

References sha512_finish().

static void sha512_hmac_finish_wrap ( void *  ctx,
unsigned char *  output 
) [static]

Definition at line 737 of file md_wrap.c.

References sha512_hmac_finish().

static void sha512_hmac_reset_wrap ( void *  ctx  )  [static]

Definition at line 742 of file md_wrap.c.

References sha512_hmac_reset().

static void sha512_hmac_starts_wrap ( void *  ctx,
const unsigned char *  key,
size_t  keylen 
) [static]

Definition at line 727 of file md_wrap.c.

References sha512_hmac_starts().

static void sha512_hmac_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 732 of file md_wrap.c.

References sha512_hmac_update().

static void sha512_hmac_wrap ( const unsigned char *  key,
size_t  keylen,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output 
) [static]

Definition at line 747 of file md_wrap.c.

References sha512_hmac().

static void sha512_process_wrap ( void *  ctx,
const unsigned char *  data 
) [static]

Definition at line 764 of file md_wrap.c.

References sha512_process().

static void sha512_starts_wrap ( void *  ctx  )  [static]

Definition at line 695 of file md_wrap.c.

References sha512_starts().

static void sha512_update_wrap ( void *  ctx,
const unsigned char *  input,
size_t  ilen 
) [static]

Definition at line 700 of file md_wrap.c.

References sha512_update().

static void sha512_wrap ( const unsigned char *  input,
size_t  ilen,
unsigned char *  output 
) [static]

Definition at line 710 of file md_wrap.c.

References sha512().


Variable Documentation


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