Hannes Tschofenig
/
aes-gcm-test-program
Example program to test AES-GCM functionality. Used for a workshop
SSL/include/polarssl/entropy_poll.h@0:796d0f61a05b, 2018-09-27 (annotated)
- Committer:
- HannesTschofenig
- Date:
- Thu Sep 27 06:34:22 2018 +0000
- Revision:
- 0:796d0f61a05b
Example AES-GCM test program
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
HannesTschofenig | 0:796d0f61a05b | 1 | /** |
HannesTschofenig | 0:796d0f61a05b | 2 | * \file entropy_poll.h |
HannesTschofenig | 0:796d0f61a05b | 3 | * |
HannesTschofenig | 0:796d0f61a05b | 4 | * \brief Platform-specific and custom entropy polling functions |
HannesTschofenig | 0:796d0f61a05b | 5 | * |
HannesTschofenig | 0:796d0f61a05b | 6 | * Copyright (C) 2006-2011, Brainspark B.V. |
HannesTschofenig | 0:796d0f61a05b | 7 | * |
HannesTschofenig | 0:796d0f61a05b | 8 | * This file is part of PolarSSL (http://www.polarssl.org) |
HannesTschofenig | 0:796d0f61a05b | 9 | * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org> |
HannesTschofenig | 0:796d0f61a05b | 10 | * |
HannesTschofenig | 0:796d0f61a05b | 11 | * All rights reserved. |
HannesTschofenig | 0:796d0f61a05b | 12 | * |
HannesTschofenig | 0:796d0f61a05b | 13 | * This program is free software; you can redistribute it and/or modify |
HannesTschofenig | 0:796d0f61a05b | 14 | * it under the terms of the GNU General Public License as published by |
HannesTschofenig | 0:796d0f61a05b | 15 | * the Free Software Foundation; either version 2 of the License, or |
HannesTschofenig | 0:796d0f61a05b | 16 | * (at your option) any later version. |
HannesTschofenig | 0:796d0f61a05b | 17 | * |
HannesTschofenig | 0:796d0f61a05b | 18 | * This program is distributed in the hope that it will be useful, |
HannesTschofenig | 0:796d0f61a05b | 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
HannesTschofenig | 0:796d0f61a05b | 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
HannesTschofenig | 0:796d0f61a05b | 21 | * GNU General Public License for more details. |
HannesTschofenig | 0:796d0f61a05b | 22 | * |
HannesTschofenig | 0:796d0f61a05b | 23 | * You should have received a copy of the GNU General Public License along |
HannesTschofenig | 0:796d0f61a05b | 24 | * with this program; if not, write to the Free Software Foundation, Inc., |
HannesTschofenig | 0:796d0f61a05b | 25 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
HannesTschofenig | 0:796d0f61a05b | 26 | */ |
HannesTschofenig | 0:796d0f61a05b | 27 | #ifndef POLARSSL_ENTROPY_POLL_H |
HannesTschofenig | 0:796d0f61a05b | 28 | #define POLARSSL_ENTROPY_POLL_H |
HannesTschofenig | 0:796d0f61a05b | 29 | |
HannesTschofenig | 0:796d0f61a05b | 30 | #include <string.h> |
HannesTschofenig | 0:796d0f61a05b | 31 | |
HannesTschofenig | 0:796d0f61a05b | 32 | #if !defined(POLARSSL_CONFIG_FILE) |
HannesTschofenig | 0:796d0f61a05b | 33 | #include "config.h" |
HannesTschofenig | 0:796d0f61a05b | 34 | #else |
HannesTschofenig | 0:796d0f61a05b | 35 | #include POLARSSL_CONFIG_FILE |
HannesTschofenig | 0:796d0f61a05b | 36 | #endif |
HannesTschofenig | 0:796d0f61a05b | 37 | |
HannesTschofenig | 0:796d0f61a05b | 38 | #ifdef __cplusplus |
HannesTschofenig | 0:796d0f61a05b | 39 | extern "C" { |
HannesTschofenig | 0:796d0f61a05b | 40 | #endif |
HannesTschofenig | 0:796d0f61a05b | 41 | |
HannesTschofenig | 0:796d0f61a05b | 42 | /* |
HannesTschofenig | 0:796d0f61a05b | 43 | * Default thresholds for built-in sources |
HannesTschofenig | 0:796d0f61a05b | 44 | */ |
HannesTschofenig | 0:796d0f61a05b | 45 | #define ENTROPY_MIN_PLATFORM 128 /**< Minimum for platform source */ |
HannesTschofenig | 0:796d0f61a05b | 46 | #define ENTROPY_MIN_HAVEGE 128 /**< Minimum for HAVEGE */ |
HannesTschofenig | 0:796d0f61a05b | 47 | #define ENTROPY_MIN_HARDCLOCK 32 /**< Minimum for hardclock() */ |
HannesTschofenig | 0:796d0f61a05b | 48 | |
HannesTschofenig | 0:796d0f61a05b | 49 | #if !defined(POLARSSL_NO_PLATFORM_ENTROPY) |
HannesTschofenig | 0:796d0f61a05b | 50 | /** |
HannesTschofenig | 0:796d0f61a05b | 51 | * \brief Platform-specific entropy poll callback |
HannesTschofenig | 0:796d0f61a05b | 52 | */ |
HannesTschofenig | 0:796d0f61a05b | 53 | int platform_entropy_poll( void *data, |
HannesTschofenig | 0:796d0f61a05b | 54 | unsigned char *output, size_t len, size_t *olen ); |
HannesTschofenig | 0:796d0f61a05b | 55 | #endif |
HannesTschofenig | 0:796d0f61a05b | 56 | |
HannesTschofenig | 0:796d0f61a05b | 57 | #if defined(POLARSSL_HAVEGE_C) |
HannesTschofenig | 0:796d0f61a05b | 58 | /** |
HannesTschofenig | 0:796d0f61a05b | 59 | * \brief HAVEGE based entropy poll callback |
HannesTschofenig | 0:796d0f61a05b | 60 | * |
HannesTschofenig | 0:796d0f61a05b | 61 | * Requires an HAVEGE state as its data pointer. |
HannesTschofenig | 0:796d0f61a05b | 62 | */ |
HannesTschofenig | 0:796d0f61a05b | 63 | int havege_poll( void *data, |
HannesTschofenig | 0:796d0f61a05b | 64 | unsigned char *output, size_t len, size_t *olen ); |
HannesTschofenig | 0:796d0f61a05b | 65 | #endif |
HannesTschofenig | 0:796d0f61a05b | 66 | |
HannesTschofenig | 0:796d0f61a05b | 67 | #if defined(POLARSSL_TIMING_C) |
HannesTschofenig | 0:796d0f61a05b | 68 | /** |
HannesTschofenig | 0:796d0f61a05b | 69 | * \brief hardclock-based entropy poll callback |
HannesTschofenig | 0:796d0f61a05b | 70 | */ |
HannesTschofenig | 0:796d0f61a05b | 71 | int hardclock_poll( void *data, |
HannesTschofenig | 0:796d0f61a05b | 72 | unsigned char *output, size_t len, size_t *olen ); |
HannesTschofenig | 0:796d0f61a05b | 73 | #endif |
HannesTschofenig | 0:796d0f61a05b | 74 | |
HannesTschofenig | 0:796d0f61a05b | 75 | #ifdef __cplusplus |
HannesTschofenig | 0:796d0f61a05b | 76 | } |
HannesTschofenig | 0:796d0f61a05b | 77 | #endif |
HannesTschofenig | 0:796d0f61a05b | 78 | |
HannesTschofenig | 0:796d0f61a05b | 79 | #endif /* entropy_poll.h */ |
HannesTschofenig | 0:796d0f61a05b | 80 | |
HannesTschofenig | 0:796d0f61a05b | 81 |