00001
00027 #ifndef POLARSSL_PADLOCK_H
00028 #define POLARSSL_PADLOCK_H
00029
00030 #include "aes.h"
00031
00032 #define POLARSSL_ERR_PADLOCK_DATA_MISALIGNED -0x0030
00034 #if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && defined(__i386__)
00035
00036 #ifndef POLARSSL_HAVE_X86
00037 #define POLARSSL_HAVE_X86
00038 #endif
00039
00040 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
00041 #include <basetsd.h>
00042 typedef INT32 int32_t;
00043 #else
00044 #include <inttypes.h>
00045 #endif
00046
00047
00048 #define PADLOCK_RNG 0x000C
00049 #define PADLOCK_ACE 0x00C0
00050 #define PADLOCK_PHE 0x0C00
00051 #define PADLOCK_PMM 0x3000
00052
00053 #define PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15))
00054
00055 #ifdef __cplusplus
00056 extern "C" {
00057 #endif
00058
00066 int padlock_supports( int feature );
00067
00078 int padlock_xcryptecb( aes_context *ctx,
00079 int mode,
00080 const unsigned char input[16],
00081 unsigned char output[16] );
00082
00095 int padlock_xcryptcbc( 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