Rizin
unix-like reverse engineering framework and cli tools
aes-set-decrypt-key.c File Reference
#include <stdlib.h>
#include "aes.h"

Go to the source code of this file.

Macros

#define _NETTLE_ATTRIBUTE_DEPRECATED
 

Functions

void aes_invert_key (struct aes_ctx *dst, const struct aes_ctx *src)
 
void aes_set_decrypt_key (struct aes_ctx *ctx, size_t keysize, const uint8_t *key)
 

Macro Definition Documentation

◆ _NETTLE_ATTRIBUTE_DEPRECATED

#define _NETTLE_ATTRIBUTE_DEPRECATED

Definition at line 46 of file aes-set-decrypt-key.c.

Function Documentation

◆ aes_invert_key()

void aes_invert_key ( struct aes_ctx dst,
const struct aes_ctx src 
)

Definition at line 51 of file aes-set-decrypt-key.c.

53 {
54  switch (src->key_size)
55  {
56  default: abort();
57  case AES128_KEY_SIZE:
58  aes128_invert_key(&dst->u.ctx128, &src->u.ctx128);
59  break;
60  case AES192_KEY_SIZE:
61  aes192_invert_key(&dst->u.ctx192, &src->u.ctx192);
62  break;
63  case AES256_KEY_SIZE:
64  aes256_invert_key(&dst->u.ctx256, &src->u.ctx256);
65  break;
66  }
67 
68  dst->key_size = src->key_size;
69 }
#define AES192_KEY_SIZE
Definition: aes.h:71
void aes192_invert_key(struct aes192_ctx *dst, const struct aes192_ctx *src)
#define AES256_KEY_SIZE
Definition: aes.h:72
void aes256_invert_key(struct aes256_ctx *dst, const struct aes256_ctx *src)
void aes128_invert_key(struct aes128_ctx *dst, const struct aes128_ctx *src)
#define AES128_KEY_SIZE
Definition: aes.h:70
lzma_index * src
Definition: index.h:567
char * dst
Definition: lz4.h:724

References aes128_invert_key(), AES128_KEY_SIZE, aes192_invert_key(), AES192_KEY_SIZE, aes256_invert_key(), AES256_KEY_SIZE, dst, and src.

Referenced by aes_set_decrypt_key().

◆ aes_set_decrypt_key()

void aes_set_decrypt_key ( struct aes_ctx ctx,
size_t  keysize,
const uint8_t key 
)

Definition at line 72 of file aes-set-decrypt-key.c.

74 {
75  /* We first create subkeys for encryption,
76  * then modify the subkeys for decryption. */
77  aes_set_encrypt_key(ctx, keysize, key);
79 }
void aes_invert_key(struct aes_ctx *dst, const struct aes_ctx *src)
#define aes_set_encrypt_key
Definition: aes.h:47
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

References aes_invert_key(), aes_set_encrypt_key, and key.