PolarSSL v1.1.4
padlock.h
Go to the documentation of this file.
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 #define PADLOCK_RNG 0x000C
00041 #define PADLOCK_ACE 0x00C0
00042 #define PADLOCK_PHE 0x0C00
00043 #define PADLOCK_PMM 0x3000
00044 
00045 #define PADLOCK_ALIGN16(x) (unsigned long *) (16 + ((long) x & ~15))
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050 
00058 int padlock_supports( int feature );
00059 
00070 int padlock_xcryptecb( aes_context *ctx,
00071                        int mode,
00072                        const unsigned char input[16],
00073                        unsigned char output[16] );
00074 
00087 int padlock_xcryptcbc( aes_context *ctx,
00088                        int mode,
00089                        size_t length,
00090                        unsigned char iv[16],
00091                        const unsigned char *input,
00092                        unsigned char *output );
00093 
00094 #ifdef __cplusplus
00095 }
00096 #endif
00097 
00098 #endif /* HAVE_X86  */
00099 
00100 #endif /* padlock.h */