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 #if !defined(MBEDTLS_CONFIG_FILE)
00029 #include "config.h"
00030 #else
00031 #include MBEDTLS_CONFIG_FILE
00032 #endif
00033
00034 #include "aes.h"
00035
00036 #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030
00038 #if defined(__has_feature)
00039 #if __has_feature(address_sanitizer)
00040 #define MBEDTLS_HAVE_ASAN
00041 #endif
00042 #endif
00043
00044
00045 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \
00046 !defined(MBEDTLS_HAVE_ASAN)
00047
00048 #ifndef MBEDTLS_HAVE_X86
00049 #define MBEDTLS_HAVE_X86
00050 #endif
00051
00052 #include <stdint.h>
00053
00054 #define MBEDTLS_PADLOCK_RNG 0x000C
00055 #define MBEDTLS_PADLOCK_ACE 0x00C0
00056 #define MBEDTLS_PADLOCK_PHE 0x0C00
00057 #define MBEDTLS_PADLOCK_PMM 0x3000
00058
00059 #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15))
00060
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif
00064
00072 int mbedtls_padlock_has_support( int feature );
00073
00084 int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx,
00085 int mode,
00086 const unsigned char input[16],
00087 unsigned char output[16] );
00088
00101 int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx,
00102 int mode,
00103 size_t length,
00104 unsigned char iv[16],
00105 const unsigned char *input,
00106 unsigned char *output );
00107
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111
00112 #endif
00113
00114 #endif