3 * Copyright (C) 2013 wolfSSL Inc.
5 * This file is part of CyaSSL.
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 /* des.h defines mini des openssl compatibility layer
31 #include <cyassl/ctaocrypt/settings.h>
34 #include "prefix_des.h"
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;
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,
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);
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);
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;
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
87 #endif /* CYASSL_DES_H_ */