summaryrefslogtreecommitdiff
path: root/mbglib/common/aes128.h
blob: c2fe9127bcb41ce396685be3277788c3dfcde0c4 (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

/**************************************************************************
 *
 *  $Id: aes128.h 1.3 2009/10/01 14:04:52 martin REL_M $
 *
 *  Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
 *
 *  Description:
 *    Definitions and prototypes for aes128.c.
 *
 * -----------------------------------------------------------------------
 *  $Log: aes128.h $
 *  Revision 1.3  2009/10/01 14:04:52  martin
 *  Code cleanup.
 *  Updated function prototypes.
 *  Revision 1.2  2006/08/22 15:28:11Z  martin
 *  Added standard file header.
 *  Added definition for AES_BLOCK_SIZE.
 *
 **************************************************************************/

#ifndef _AES128_H
#define _AES128_H

/* Other headers to be included */

#include <words.h>


#ifdef _AES128
 #define _ext
 #define _DO_INIT
#else
 #define _ext extern
#endif


/* Start of header body */

#define AES_BLOCK_SIZE    16


typedef struct
{
    unsigned long erk[64];     /* encryption round keys */
    unsigned long drk[64];     /* decryption round keys */
} aes128_context;

/* function prototypes: */

#ifdef __cplusplus
extern "C" {
#endif

/* ----- function prototypes begin ----- */

/* This section was generated automatically */
/* by MAKEHDR, do not remove the comments. */

 void aes_gen_tables( void ) ;
 int aes128_set_key( aes128_context *ctx, uint8_t *key ) ;
 int aes_encrypt_buff( uint8_t *p_data, uint8_t *p_key, uint8_t *p_init, int n ) ;
 int aes_decrypt_buff ( uint8_t *p_data, uint8_t *p_key, uint8_t *p_init, int n ) ;

/* ----- function prototypes end ----- */

#ifdef __cplusplus
}
#endif


/* End of header body */

#undef _ext
#undef _DO_INIT

#endif  /* _AES128_H */