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
00051
00052 #ifndef MBEDTLS_PADLOCK_H
00053 #define MBEDTLS_PADLOCK_H
00054
00055 #if !defined(MBEDTLS_CONFIG_FILE)
00056 #include "config.h"
00057 #else
00058 #include MBEDTLS_CONFIG_FILE
00059 #endif
00060
00061 #include "aes.h"
00062
00063 #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030
00065 #if defined(__has_feature)
00066 #if __has_feature(address_sanitizer)
00067 #define MBEDTLS_HAVE_ASAN
00068 #endif
00069 #endif
00070
00071
00072 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \
00073 !defined(MBEDTLS_HAVE_ASAN)
00074
00075 #ifndef MBEDTLS_HAVE_X86
00076 #define MBEDTLS_HAVE_X86
00077 #endif
00078
00079 #include <stdint.h>
00080
00081 #define MBEDTLS_PADLOCK_RNG 0x000C
00082 #define MBEDTLS_PADLOCK_ACE 0x00C0
00083 #define MBEDTLS_PADLOCK_PHE 0x0C00
00084 #define MBEDTLS_PADLOCK_PMM 0x3000
00085
00086 #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15))
00087
00088 #ifdef __cplusplus
00089 extern "C" {
00090 #endif
00091
00099 int mbedtls_padlock_has_support( int feature );
00100
00111 int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx,
00112 int mode,
00113 const unsigned char input[16],
00114 unsigned char output[16] );
00115
00128 int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx,
00129 int mode,
00130 size_t length,
00131 unsigned char iv[16],
00132 const unsigned char *input,
00133 unsigned char *output );
00134
00135 #ifdef __cplusplus
00136 }
00137 #endif
00138
00139 #endif
00140
00141 #endif