00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef MBEDTLS_PADLOCK_H
00026 #define MBEDTLS_PADLOCK_H
00027
00028 #include "aes.h"
00029
00030 #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030
00032 #if defined(__has_feature)
00033 #if __has_feature(address_sanitizer)
00034 #define MBEDTLS_HAVE_ASAN
00035 #endif
00036 #endif
00037
00038
00039 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \
00040 !defined(MBEDTLS_HAVE_ASAN)
00041
00042 #ifndef MBEDTLS_HAVE_X86
00043 #define MBEDTLS_HAVE_X86
00044 #endif
00045
00046 #include <stdint.h>
00047
00048 #define MBEDTLS_PADLOCK_RNG 0x000C
00049 #define MBEDTLS_PADLOCK_ACE 0x00C0
00050 #define MBEDTLS_PADLOCK_PHE 0x0C00
00051 #define MBEDTLS_PADLOCK_PMM 0x3000
00052
00053 #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15))
00054
00055 #ifdef __cplusplus
00056 extern "C" {
00057 #endif
00058
00066 int mbedtls_padlock_has_support( int feature );
00067
00078 int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx,
00079 int mode,
00080 const unsigned char input[16],
00081 unsigned char output[16] );
00082
00095 int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx,
00096 int mode,
00097 size_t length,
00098 unsigned char iv[16],
00099 const unsigned char *input,
00100 unsigned char *output );
00101
00102 #ifdef __cplusplus
00103 }
00104 #endif
00105
00106 #endif
00107
00108 #endif