mbed TLS v1.3.21
padlock.h
Go to the documentation of this file.
1 
25 #ifndef POLARSSL_PADLOCK_H
26 #define POLARSSL_PADLOCK_H
27 
28 #include "aes.h"
29 
30 #define POLARSSL_ERR_PADLOCK_DATA_MISALIGNED -0x0030
32 #if defined(__has_feature)
33 #if __has_feature(address_sanitizer)
34 #define POLARSSL_HAVE_ASAN
35 #endif
36 #endif
37 
38 /* Some versions of ASan result in errors about not enough registers */
39 #if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \
40  !defined(POLARSSL_HAVE_ASAN)
41 
42 #ifndef POLARSSL_HAVE_X86
43 #define POLARSSL_HAVE_X86
44 #endif
45 
46 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
47 #include <basetsd.h>
48 typedef INT32 int32_t;
49 #else
50 #include <inttypes.h>
51 #endif
52 
53 #define PADLOCK_RNG 0x000C
54 #define PADLOCK_ACE 0x00C0
55 #define PADLOCK_PHE 0x0C00
56 #define PADLOCK_PMM 0x3000
57 
58 #define PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15))
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
71 int padlock_supports( int feature );
72 
83 int padlock_xcryptecb( aes_context *ctx,
84  int mode,
85  const unsigned char input[16],
86  unsigned char output[16] );
87 
100 int padlock_xcryptcbc( aes_context *ctx,
101  int mode,
102  size_t length,
103  unsigned char iv[16],
104  const unsigned char *input,
105  unsigned char *output );
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif /* HAVE_X86 */
112 
113 #endif /* padlock.h */
AES context structure.
Definition: aes.h:65
AES block cipher.