ReactOS 0.4.15-dev-8614-gbc76250
nist_kw.h
Go to the documentation of this file.
1
18/*
19 * Copyright The Mbed TLS Contributors
20 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
21 *
22 * This file is provided under the Apache License 2.0, or the
23 * GNU General Public License v2.0 or later.
24 *
25 * **********
26 * Apache License 2.0:
27 *
28 * Licensed under the Apache License, Version 2.0 (the "License"); you may
29 * not use this file except in compliance with the License.
30 * You may obtain a copy of the License at
31 *
32 * http://www.apache.org/licenses/LICENSE-2.0
33 *
34 * Unless required by applicable law or agreed to in writing, software
35 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
36 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37 * See the License for the specific language governing permissions and
38 * limitations under the License.
39 *
40 * **********
41 *
42 * **********
43 * GNU General Public License v2.0 or later:
44 *
45 * This program is free software; you can redistribute it and/or modify
46 * it under the terms of the GNU General Public License as published by
47 * the Free Software Foundation; either version 2 of the License, or
48 * (at your option) any later version.
49 *
50 * This program is distributed in the hope that it will be useful,
51 * but WITHOUT ANY WARRANTY; without even the implied warranty of
52 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53 * GNU General Public License for more details.
54 *
55 * You should have received a copy of the GNU General Public License along
56 * with this program; if not, write to the Free Software Foundation, Inc.,
57 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
58 *
59 * **********
60 */
61
62#ifndef MBEDTLS_NIST_KW_H
63#define MBEDTLS_NIST_KW_H
64
65#if !defined(MBEDTLS_CONFIG_FILE)
66#include "config.h"
67#else
68#include MBEDTLS_CONFIG_FILE
69#endif
70
71#include "cipher.h"
72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
77typedef enum
78{
82
83#if !defined(MBEDTLS_NIST_KW_ALT)
84// Regular implementation
85//
86
94typedef struct {
97
98#else /* MBEDTLS_NIST_key wrapping_ALT */
99#include "nist_kw_alt.h"
100#endif /* MBEDTLS_NIST_KW_ALT */
101
111
130 const unsigned char *key,
131 unsigned int keybits,
132 const int is_wrap );
133
141
164 const unsigned char *input, size_t in_len,
165 unsigned char *output, size_t* out_len, size_t out_size );
166
191 const unsigned char *input, size_t in_len,
192 unsigned char *output, size_t* out_len, size_t out_size);
193
194
195#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
202int mbedtls_nist_kw_self_test( int verbose );
203#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */
204
205#ifdef __cplusplus
206}
207#endif
208
209#endif /* MBEDTLS_NIST_KW_H */
This file contains an abstraction interface for use with the cipher primitives provided by the librar...
mbedtls_cipher_id_t
Supported cipher types.
Definition: cipher.h:109
GLenum mode
Definition: glext.h:6217
GLenum GLenum GLenum input
Definition: glext.h:9031
static DATA_BLOB cipher
Definition: protectdata.c:38
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
Definition: file.c:100
int mbedtls_nist_kw_setkey(mbedtls_nist_kw_context *ctx, mbedtls_cipher_id_t cipher, const unsigned char *key, unsigned int keybits, const int is_wrap)
This function initializes the key wrapping context set in the ctx parameter and sets the encryption k...
int mbedtls_nist_kw_wrap(mbedtls_nist_kw_context *ctx, mbedtls_nist_kw_mode_t mode, const unsigned char *input, size_t in_len, unsigned char *output, size_t *out_len, size_t out_size)
This function encrypts a buffer using key wrapping.
int mbedtls_nist_kw_unwrap(mbedtls_nist_kw_context *ctx, mbedtls_nist_kw_mode_t mode, const unsigned char *input, size_t in_len, unsigned char *output, size_t *out_len, size_t out_size)
This function decrypts a buffer using key wrapping.
mbedtls_nist_kw_mode_t
Definition: nist_kw.h:78
@ MBEDTLS_KW_MODE_KW
Definition: nist_kw.h:79
@ MBEDTLS_KW_MODE_KWP
Definition: nist_kw.h:80
void mbedtls_nist_kw_free(mbedtls_nist_kw_context *ctx)
This function releases and clears the specified key wrapping context and underlying cipher sub-contex...
void mbedtls_nist_kw_init(mbedtls_nist_kw_context *ctx)
This function initializes the specified key wrapping context to make references valid and prepare the...
#define verbose
Definition: rosglue.h:36
Definition: copy.c:22
The key wrapping context-type definition. The key wrapping context is passed to the APIs called.
Definition: nist_kw.h:94
mbedtls_cipher_context_t cipher_ctx
Definition: nist_kw.h:95