00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef MBEDTLS_PADLOCK_H
00051 #define MBEDTLS_PADLOCK_H
00052
00053 #if !defined(MBEDTLS_CONFIG_FILE)
00054 #include "config.h"
00055 #else
00056 #include MBEDTLS_CONFIG_FILE
00057 #endif
00058
00059 #include "aes.h"
00060
00061 #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030
00063 #if defined(__has_feature)
00064 #if __has_feature(address_sanitizer)
00065 #define MBEDTLS_HAVE_ASAN
00066 #endif
00067 #endif
00068
00069
00070 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \
00071 !defined(MBEDTLS_HAVE_ASAN)
00072
00073 #ifndef MBEDTLS_HAVE_X86
00074 #define MBEDTLS_HAVE_X86
00075 #endif
00076
00077 #include <stdint.h>
00078
00079 #define MBEDTLS_PADLOCK_RNG 0x000C
00080 #define MBEDTLS_PADLOCK_ACE 0x00C0
00081 #define MBEDTLS_PADLOCK_PHE 0x0C00
00082 #define MBEDTLS_PADLOCK_PMM 0x3000
00083
00084 #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15))
00085
00086 #ifdef __cplusplus
00087 extern "C" {
00088 #endif
00089
00097 int mbedtls_padlock_has_support( int feature );
00098
00109 int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx,
00110 int mode,
00111 const unsigned char input[16],
00112 unsigned char output[16] );
00113
00126 int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx,
00127 int mode,
00128 size_t length,
00129 unsigned char iv[16],
00130 const unsigned char *input,
00131 unsigned char *output );
00132
00133 #ifdef __cplusplus
00134 }
00135 #endif
00136
00137 #endif
00138
00139 #endif