mbed TLS v2.3.0
padlock.h
Go to the documentation of this file.
1 
26 #ifndef MBEDTLS_PADLOCK_H
27 #define MBEDTLS_PADLOCK_H
28 
29 #include "aes.h"
30 
31 #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030
33 #if defined(__has_feature)
34 #if __has_feature(address_sanitizer)
35 #define MBEDTLS_HAVE_ASAN
36 #endif
37 #endif
38 
39 /* Some versions of ASan result in errors about not enough registers */
40 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \
41  !defined(MBEDTLS_HAVE_ASAN)
42 
43 #ifndef MBEDTLS_HAVE_X86
44 #define MBEDTLS_HAVE_X86
45 #endif
46 
47 #include <stdint.h>
48 
49 #define MBEDTLS_PADLOCK_RNG 0x000C
50 #define MBEDTLS_PADLOCK_ACE 0x00C0
51 #define MBEDTLS_PADLOCK_PHE 0x0C00
52 #define MBEDTLS_PADLOCK_PMM 0x3000
53 
54 #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15))
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
67 int mbedtls_padlock_has_support( int feature );
68 
79 int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx,
80  int mode,
81  const unsigned char input[16],
82  unsigned char output[16] );
83 
96 int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx,
97  int mode,
98  size_t length,
99  unsigned char iv[16],
100  const unsigned char *input,
101  unsigned char *output );
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif /* HAVE_X86 */
108 
109 #endif /* padlock.h */
AES block cipher.
AES context structure.
Definition: aes.h:60