mbed TLS v2.7.15
padlock.h
Go to the documentation of this file.
1 
7 /*
8  * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
9  * SPDX-License-Identifier: Apache-2.0
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License"); you may
12  * not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
19  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  *
23  * This file is part of mbed TLS (https://tls.mbed.org)
24  */
25 #ifndef MBEDTLS_PADLOCK_H
26 #define MBEDTLS_PADLOCK_H
27 
28 #if !defined(MBEDTLS_CONFIG_FILE)
29 #include "config.h"
30 #else
31 #include MBEDTLS_CONFIG_FILE
32 #endif
33 
34 #include "aes.h"
35 
36 #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030
38 #if defined(__has_feature)
39 #if __has_feature(address_sanitizer)
40 #define MBEDTLS_HAVE_ASAN
41 #endif
42 #endif
43 
44 /* Some versions of ASan result in errors about not enough registers */
45 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \
46  !defined(MBEDTLS_HAVE_ASAN)
47 
48 #ifndef MBEDTLS_HAVE_X86
49 #define MBEDTLS_HAVE_X86
50 #endif
51 
52 #include <stdint.h>
53 
54 #define MBEDTLS_PADLOCK_RNG 0x000C
55 #define MBEDTLS_PADLOCK_ACE 0x00C0
56 #define MBEDTLS_PADLOCK_PHE 0x0C00
57 #define MBEDTLS_PADLOCK_PMM 0x3000
58 
59 #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15))
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
72 int mbedtls_padlock_has_support( int feature );
73 
84 int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx,
85  int mode,
86  const unsigned char input[16],
87  unsigned char output[16] );
88 
101 int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx,
102  int mode,
103  size_t length,
104  unsigned char iv[16],
105  const unsigned char *input,
106  unsigned char *output );
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif /* HAVE_X86 */
113 
114 #endif /* padlock.h */
Configuration options (set of defines)
The Advanced Encryption Standard (AES) specifies a FIPS-approved cryptographic algorithm that can be ...
The AES context-type definition.
Definition: aes.h:73