Rizin
unix-like reverse engineering framework and cli tools
aes128-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 /* aes128-set-decrypt-key.c
5 
6  Key setup for the aes/rijndael block cipher.
7 
8  Copyright (C) 2013, Niels Möller
9 
10  This file is part of GNU Nettle.
11 
12  GNU Nettle is free software: you can redistribute it and/or
13  modify it under the terms of either:
14 
15  * the GNU Lesser General Public License as published by the Free
16  Software Foundation; either version 3 of the License, or (at your
17  option) any later version.
18 
19  or
20 
21  * the GNU General Public License as published by the Free
22  Software Foundation; either version 2 of the License, or (at your
23  option) any later version.
24 
25  or both in parallel, as here.
26 
27  GNU Nettle is distributed in the hope that it will be useful,
28  but WITHOUT ANY WARRANTY; without even the implied warranty of
29  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30  General Public License for more details.
31 
32  You should have received copies of the GNU General Public License and
33  the GNU Lesser General Public License along with this program. If
34  not, see http://www.gnu.org/licenses/.
35 */
36 
37 #if HAVE_CONFIG_H
38 # include "config.h"
39 #endif
40 
41 #include <assert.h>
42 
43 #include "aes-internal.h"
44 #include "macros.h"
45 
46 /* For fat builds */
47 #if HAVE_NATIVE_aes128_invert_key
48 void
49 _nettle_aes128_invert_key_c(struct aes128_ctx *dst,
50  const struct aes128_ctx *src);
51 # define nettle_aes128_invert_key _nettle_aes128_invert_key_c
52 #endif
53 
54 #if HAVE_NATIVE_aes128_set_decrypt_key
55 void
56 _nettle_aes128_set_decrypt_key_c(struct aes128_ctx *ctx, const uint8_t *key);
57 # define nettle_aes128_set_decrypt_key _nettle_aes128_set_decrypt_key_c
58 #endif
59 
60 void
62 {
63  _nettle_aes_invert (_AES128_ROUNDS, dst->keys, src->keys);
64 }
65 
66 void
68 {
71 }
void _nettle_aes_invert(unsigned rounds, uint32_t *dst, const uint32_t *src)
void nettle_aes128_invert_key(struct aes128_ctx *dst, const struct aes128_ctx *src)
void nettle_aes128_set_decrypt_key(struct aes128_ctx *ctx, const uint8_t *key)
void aes128_set_encrypt_key(struct aes128_ctx *ctx, const uint8_t *key)
void aes128_invert_key(struct aes128_ctx *dst, const struct aes128_ctx *src)
#define _AES128_ROUNDS
Definition: aes.h:73
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
Definition: aes.h:78