mbed TLS v2.16.6
padlock.h
Go to the documentation of this file.
1 
10 /*
11  * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
12  * SPDX-License-Identifier: GPL-2.0
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27  *
28  * This file is part of mbed TLS (https://tls.mbed.org)
29  */
30 #ifndef MBEDTLS_PADLOCK_H
31 #define MBEDTLS_PADLOCK_H
32 
33 #if !defined(MBEDTLS_CONFIG_FILE)
34 #include "config.h"
35 #else
36 #include MBEDTLS_CONFIG_FILE
37 #endif
38 
39 #include "aes.h"
40 
41 #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030
43 #if defined(__has_feature)
44 #if __has_feature(address_sanitizer)
45 #define MBEDTLS_HAVE_ASAN
46 #endif
47 #endif
48 
49 /* Some versions of ASan result in errors about not enough registers */
50 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \
51  !defined(MBEDTLS_HAVE_ASAN)
52 
53 #ifndef MBEDTLS_HAVE_X86
54 #define MBEDTLS_HAVE_X86
55 #endif
56 
57 #include <stdint.h>
58 
59 #define MBEDTLS_PADLOCK_RNG 0x000C
60 #define MBEDTLS_PADLOCK_ACE 0x00C0
61 #define MBEDTLS_PADLOCK_PHE 0x0C00
62 #define MBEDTLS_PADLOCK_PMM 0x3000
63 
64 #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) (x) & ~15))
65 
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69 
80 int mbedtls_padlock_has_support( int feature );
81 
95 int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx,
96  int mode,
97  const unsigned char input[16],
98  unsigned char output[16] );
99 
115 int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx,
116  int mode,
117  size_t length,
118  unsigned char iv[16],
119  const unsigned char *input,
120  unsigned char *output );
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif /* HAVE_X86 */
127 
128 #endif /* padlock.h */
Configuration options (set of defines)
This file contains AES definitions and functions.
The AES context-type definition.
Definition: aes.h:88