00001 00007 /* 00008 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 00009 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 00010 * 00011 * This file is provided under the Apache License 2.0, or the 00012 * GNU General Public License v2.0 or later. 00013 * 00014 * ********** 00015 * Apache License 2.0: 00016 * 00017 * Licensed under the Apache License, Version 2.0 (the "License"); you may 00018 * not use this file except in compliance with the License. 00019 * You may obtain a copy of the License at 00020 * 00021 * http://www.apache.org/licenses/LICENSE-2.0 00022 * 00023 * Unless required by applicable law or agreed to in writing, software 00024 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 00025 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00026 * See the License for the specific language governing permissions and 00027 * limitations under the License. 00028 * 00029 * ********** 00030 * 00031 * ********** 00032 * GNU General Public License v2.0 or later: 00033 * 00034 * This program is free software; you can redistribute it and/or modify 00035 * it under the terms of the GNU General Public License as published by 00036 * the Free Software Foundation; either version 2 of the License, or 00037 * (at your option) any later version. 00038 * 00039 * This program is distributed in the hope that it will be useful, 00040 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00041 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00042 * GNU General Public License for more details. 00043 * 00044 * You should have received a copy of the GNU General Public License along 00045 * with this program; if not, write to the Free Software Foundation, Inc., 00046 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00047 * 00048 * ********** 00049 * 00050 * This file is part of mbed TLS (https://tls.mbed.org) 00051 */ 00052 #ifndef MBEDTLS_PADLOCK_H 00053 #define MBEDTLS_PADLOCK_H 00054 00055 #if !defined(MBEDTLS_CONFIG_FILE) 00056 #include "config.h" 00057 #else 00058 #include MBEDTLS_CONFIG_FILE 00059 #endif 00060 00061 #include "aes.h" 00062 00063 #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030 00065 #if defined(__has_feature) 00066 #if __has_feature(address_sanitizer) 00067 #define MBEDTLS_HAVE_ASAN 00068 #endif 00069 #endif 00070 00071 /* Some versions of ASan result in errors about not enough registers */ 00072 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \ 00073 !defined(MBEDTLS_HAVE_ASAN) 00074 00075 #ifndef MBEDTLS_HAVE_X86 00076 #define MBEDTLS_HAVE_X86 00077 #endif 00078 00079 #include <stdint.h> 00080 00081 #define MBEDTLS_PADLOCK_RNG 0x000C 00082 #define MBEDTLS_PADLOCK_ACE 0x00C0 00083 #define MBEDTLS_PADLOCK_PHE 0x0C00 00084 #define MBEDTLS_PADLOCK_PMM 0x3000 00085 00086 #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15)) 00087 00088 #ifdef __cplusplus 00089 extern "C" { 00090 #endif 00091 00099 int mbedtls_padlock_has_support( int feature ); 00100 00111 int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx, 00112 int mode, 00113 const unsigned char input[16], 00114 unsigned char output[16] ); 00115 00128 int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx, 00129 int mode, 00130 size_t length, 00131 unsigned char iv[16], 00132 const unsigned char *input, 00133 unsigned char *output ); 00134 00135 #ifdef __cplusplus 00136 } 00137 #endif 00138 00139 #endif /* HAVE_X86 */ 00140 00141 #endif /* padlock.h */
1.6.1