Rizin
unix-like reverse engineering framework and cli tools
aes256-set-decrypt-key.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2013 Niels Möller
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 /* aes256-set-decrypt-key.c
5 
6  Copyright (C) 2013, Niels Möller
7 
8  This file is part of GNU Nettle.
9 
10  GNU Nettle is free software: you can redistribute it and/or
11  modify it under the terms of either:
12 
13  * the GNU Lesser General Public License as published by the Free
14  Software Foundation; either version 3 of the License, or (at your
15  option) any later version.
16 
17  or
18 
19  * the GNU General Public License as published by the Free
20  Software Foundation; either version 2 of the License, or (at your
21  option) any later version.
22 
23  or both in parallel, as here.
24 
25  GNU Nettle is distributed in the hope that it will be useful,
26  but WITHOUT ANY WARRANTY; without even the implied warranty of
27  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  General Public License for more details.
29 
30  You should have received copies of the GNU General Public License and
31  the GNU Lesser General Public License along with this program. If
32  not, see http://www.gnu.org/licenses/.
33 */
34 
35 #if HAVE_CONFIG_H
36 # include "config.h"
37 #endif
38 
39 #include <assert.h>
40 
41 #include "aes-internal.h"
42 #include "macros.h"
43 
44 /* For fat builds */
45 #if HAVE_NATIVE_aes256_invert_key
46 void
47 _nettle_aes256_invert_key_c(struct aes256_ctx *dst,
48  const struct aes256_ctx *src);
49 # define nettle_aes256_invert_key _nettle_aes256_invert_key_c
50 #endif
51 
52 #if HAVE_NATIVE_aes256_set_decrypt_key
53 void
54 _nettle_aes256_set_decrypt_key_c(struct aes256_ctx *ctx, const uint8_t *key);
55 # define nettle_aes256_set_decrypt_key _nettle_aes256_set_decrypt_key_c
56 #endif
57 
58 void
60 {
61  _nettle_aes_invert (_AES256_ROUNDS, dst->keys, src->keys);
62 }
63 
64 void
66 {
69 }
void _nettle_aes_invert(unsigned rounds, uint32_t *dst, const uint32_t *src)
void nettle_aes256_set_decrypt_key(struct aes256_ctx *ctx, const uint8_t *key)
void nettle_aes256_invert_key(struct aes256_ctx *dst, const struct aes256_ctx *src)
void aes256_set_encrypt_key(struct aes256_ctx *ctx, const uint8_t *key)
void aes256_invert_key(struct aes256_ctx *dst, const struct aes256_ctx *src)
#define _AES256_ROUNDS
Definition: aes.h:75
lzma_index * src
Definition: index.h:567
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
Definition: sflib.h:118
char * dst
Definition: lz4.h:724
unsigned char uint8_t
Definition: sftypes.h:31