]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/des.h
Add FreeRTOS-Plus directory with new directory structure so it matches the FreeRTOS...
[freertos] / FreeRTOS-Plus / Source / CyaSSL / cyassl / openssl / des.h
1 /* des.h
2  *
3  * Copyright (C) 2012 Sawtooth Consulting Ltd.
4  *
5  * This file is part of CyaSSL.
6  *
7  * CyaSSL is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * CyaSSL is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20  */
21
22
23 /*  des.h defines mini des openssl compatibility layer 
24  *
25  */
26
27
28 #ifndef CYASSL_DES_H_
29 #define CYASSL_DES_H_
30
31 #include <cyassl/ctaocrypt/settings.h>
32
33 #ifdef YASSL_PREFIX
34 #include "prefix_des.h"
35 #endif
36
37
38 #ifdef __cplusplus
39     extern "C" {
40 #endif
41
42 typedef unsigned char CYASSL_DES_cblock[8];
43 typedef /* const */ CYASSL_DES_cblock CYASSL_const_DES_cblock;
44 typedef CYASSL_DES_cblock CYASSL_DES_key_schedule;
45
46
47 enum {
48     DES_ENCRYPT = 1,
49     DES_DECRYPT = 0
50 };
51
52
53 CYASSL_API void CyaSSL_DES_set_key_unchecked(CYASSL_const_DES_cblock*,
54                                              CYASSL_DES_key_schedule*);
55 CYASSL_API int  CyaSSL_DES_key_sched(CYASSL_const_DES_cblock* key,
56                                      CYASSL_DES_key_schedule* schedule);
57 CYASSL_API void CyaSSL_DES_cbc_encrypt(const unsigned char* input,
58                      unsigned char* output, long length,
59                      CYASSL_DES_key_schedule* schedule, CYASSL_DES_cblock* ivec,
60                      int enc);
61 CYASSL_API void CyaSSL_DES_ncbc_encrypt(const unsigned char* input,
62                       unsigned char* output, long length,
63                       CYASSL_DES_key_schedule* schedule,
64                       CYASSL_DES_cblock* ivec, int enc);
65
66 CYASSL_API void CyaSSL_DES_set_odd_parity(CYASSL_DES_cblock*);
67 CYASSL_API void CyaSSL_DES_ecb_encrypt(CYASSL_DES_cblock*, CYASSL_DES_cblock*,
68                                        CYASSL_DES_key_schedule*, int);
69
70
71 typedef CYASSL_DES_cblock DES_cblock;
72 typedef CYASSL_const_DES_cblock const_DES_cblock;
73 typedef CYASSL_DES_key_schedule DES_key_schedule;
74
75 #define DES_set_key_unchecked CyaSSL_DES_set_key_unchecked
76 #define DES_key_sched CyaSSL_DES_key_sched
77 #define DES_cbc_encrypt CyaSSL_DES_cbc_encrypt
78 #define DES_ncbc_encrypt CyaSSL_DES_ncbc_encrypt
79 #define DES_set_odd_parity CyaSSL_DES_set_odd_parity
80 #define DES_ecb_encrypt CyaSSL_DES_ecb_encrypt
81
82 #ifdef __cplusplus
83     } /* extern "C" */
84 #endif
85
86
87 #endif /* CYASSL_DES_H_ */