XenevaOS
Loading...
Searching...
No Matches
padlock.h
Go to the documentation of this file.
1
10/*
11 * Copyright The Mbed TLS Contributors
12 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
13 */
14#ifndef MBEDTLS_PADLOCK_H
15#define MBEDTLS_PADLOCK_H
16
17#include "mbedtls/build_info.h"
18
19#include "mbedtls/aes.h"
20
21#define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030
23#if defined(__has_feature)
24#if __has_feature(address_sanitizer)
25#define MBEDTLS_HAVE_ASAN
26#endif
27#endif
28
29/*
30 * - `padlock` is implements with GNUC assembly for x86 target.
31 * - Some versions of ASan result in errors about not enough registers.
32 */
33#if defined(MBEDTLS_PADLOCK_C) && \
34 defined(__GNUC__) && defined(MBEDTLS_ARCH_IS_X86) && \
35 defined(MBEDTLS_HAVE_ASM) && \
36 !defined(MBEDTLS_HAVE_ASAN)
37
38#define MBEDTLS_VIA_PADLOCK_HAVE_CODE
39
40#include <stdint.h>
41
42#define MBEDTLS_PADLOCK_RNG 0x000C
43#define MBEDTLS_PADLOCK_ACE 0x00C0
44#define MBEDTLS_PADLOCK_PHE 0x0C00
45#define MBEDTLS_PADLOCK_PMM 0x3000
46
47#define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) (x) & ~15))
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
63int mbedtls_padlock_has_support(int feature);
64
78int mbedtls_padlock_xcryptecb(mbedtls_aes_context *ctx,
79 int mode,
80 const unsigned char input[16],
81 unsigned char output[16]);
82
98int mbedtls_padlock_xcryptcbc(mbedtls_aes_context *ctx,
99 int mode,
100 size_t length,
101 unsigned char iv[16],
102 const unsigned char *input,
103 unsigned char *output);
104
105#ifdef __cplusplus
106}
107#endif
108
109#endif /* HAVE_X86 */
110
111#endif /* padlock.h */
This file contains AES definitions and functions.
Build-time configuration info.
The AES context-type definition.
Definition aes.h:63
#define mode(x)
struct VirtioInputEvent * input
Definition virtiokbd.c:46