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

Go to the source code of this file.

Functions

void aes_set_encrypt_key (struct aes_ctx *ctx, size_t key_size, const uint8_t *key)
 

Function Documentation

◆ aes_set_encrypt_key()

void aes_set_encrypt_key ( struct aes_ctx ctx,
size_t  key_size,
const uint8_t key 
)

Definition at line 48 of file aes-set-encrypt-key.c.

50 {
51  switch (key_size)
52  {
53  default: abort();
54  case AES128_KEY_SIZE:
55  aes128_set_encrypt_key(&ctx->u.ctx128, key);
56  break;
57  case AES192_KEY_SIZE:
58  aes192_set_encrypt_key(&ctx->u.ctx192, key);
59  break;
60  case AES256_KEY_SIZE:
61  aes256_set_encrypt_key(&ctx->u.ctx256, key);
62  break;
63  }
64 
65  ctx->key_size = key_size;
66 }
void aes128_set_encrypt_key(struct aes128_ctx *ctx, const uint8_t *key)
#define AES192_KEY_SIZE
Definition: aes.h:71
#define AES256_KEY_SIZE
Definition: aes.h:72
void aes256_set_encrypt_key(struct aes256_ctx *ctx, const uint8_t *key)
#define AES128_KEY_SIZE
Definition: aes.h:70
void aes192_set_encrypt_key(struct aes192_ctx *ctx, const uint8_t *key)
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 AES128_KEY_SIZE, aes128_set_encrypt_key(), AES192_KEY_SIZE, aes192_set_encrypt_key(), AES256_KEY_SIZE, aes256_set_encrypt_key(), and key.