This repository has been archived by the owner on Feb 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
aes_saes64.h
57 lines (36 loc) · 1.56 KB
/
aes_saes64.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// aes_saes64.h
// 2020-05-05 Markku-Juhani O. Saarinen <mjos@pqshield.com>
// Copyright (c) 2020, PQShield Ltd. All rights reserved.
// Implementation prototypes for aes_saes64.c
#ifndef _AES_SAES64_H_
#define _AES_SAES64_H_
#include <stdint.h>
// Set encryption key
void aes128_enc_key_saes64(uint32_t rk[AES128_RK_WORDS],
const uint8_t key[16]);
void aes192_enc_key_saes64(uint32_t rk[AES192_RK_WORDS],
const uint8_t key[24]);
void aes256_enc_key_saes64(uint32_t rk[AES256_RK_WORDS],
const uint8_t key[32]);
// Encrypt a block
void aes128_enc_ecb_saes64(uint8_t ct[16], const uint8_t pt[16],
const uint32_t rk[AES128_RK_WORDS]);
void aes192_enc_ecb_saes64(uint8_t ct[16], const uint8_t pt[16],
const uint32_t rk[AES192_RK_WORDS]);
void aes256_enc_ecb_saes64(uint8_t ct[16], const uint8_t pt[16],
const uint32_t rk[AES256_RK_WORDS]);
// Set decryption key
void aes128_dec_key_saes64(uint32_t rk[AES128_RK_WORDS],
const uint8_t key[16]);
void aes192_dec_key_saes64(uint32_t rk[AES192_RK_WORDS],
const uint8_t key[24]);
void aes256_dec_key_saes64(uint32_t rk[AES256_RK_WORDS],
const uint8_t key[32]);
// Decrypt a block
void aes128_dec_ecb_saes64(uint8_t pt[16], const uint8_t ct[16],
const uint32_t rk[AES128_RK_WORDS]);
void aes192_dec_ecb_saes64(uint8_t pt[16], const uint8_t ct[16],
const uint32_t rk[AES192_RK_WORDS]);
void aes256_dec_ecb_saes64(uint8_t pt[16], const uint8_t ct[16],
const uint32_t rk[AES256_RK_WORDS]);
#endif // _AES_SAES64_H_