CyaSSL is an SSL library for devices like mbed.

Dependents:   cyassl-client Sync

Committer:
toddouska
Date:
Sat Feb 05 01:09:17 2011 +0000
Revision:
0:5045d2638c29
Beta Version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
toddouska 0:5045d2638c29 1 /* hc128.h
toddouska 0:5045d2638c29 2 *
toddouska 0:5045d2638c29 3 * Copyright (C) 2006-2009 Sawtooth Consulting Ltd.
toddouska 0:5045d2638c29 4 *
toddouska 0:5045d2638c29 5 * This file is part of CyaSSL.
toddouska 0:5045d2638c29 6 *
toddouska 0:5045d2638c29 7 * CyaSSL is free software; you can redistribute it and/or modify
toddouska 0:5045d2638c29 8 * it under the terms of the GNU General Public License as published by
toddouska 0:5045d2638c29 9 * the Free Software Foundation; either version 2 of the License, or
toddouska 0:5045d2638c29 10 * (at your option) any later version.
toddouska 0:5045d2638c29 11 *
toddouska 0:5045d2638c29 12 * CyaSSL is distributed in the hope that it will be useful,
toddouska 0:5045d2638c29 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
toddouska 0:5045d2638c29 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
toddouska 0:5045d2638c29 15 * GNU General Public License for more details.
toddouska 0:5045d2638c29 16 *
toddouska 0:5045d2638c29 17 * You should have received a copy of the GNU General Public License
toddouska 0:5045d2638c29 18 * along with this program; if not, write to the Free Software
toddouska 0:5045d2638c29 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
toddouska 0:5045d2638c29 20 */
toddouska 0:5045d2638c29 21
toddouska 0:5045d2638c29 22
toddouska 0:5045d2638c29 23 #ifndef NO_HC128
toddouska 0:5045d2638c29 24
toddouska 0:5045d2638c29 25 #ifndef CTAO_CRYPT_HC128_H
toddouska 0:5045d2638c29 26 #define CTAO_CRYPT_HC128_H
toddouska 0:5045d2638c29 27
toddouska 0:5045d2638c29 28 #include "types.h"
toddouska 0:5045d2638c29 29
toddouska 0:5045d2638c29 30 #ifdef __cplusplus
toddouska 0:5045d2638c29 31 extern "C" {
toddouska 0:5045d2638c29 32 #endif
toddouska 0:5045d2638c29 33
toddouska 0:5045d2638c29 34
toddouska 0:5045d2638c29 35
toddouska 0:5045d2638c29 36 /* HC-128 stream cipher */
toddouska 0:5045d2638c29 37 typedef struct HC128 {
toddouska 0:5045d2638c29 38 word32 T[1024]; /* P[i] = T[i]; Q[i] = T[1024 + i ]; */
toddouska 0:5045d2638c29 39 word32 X[16];
toddouska 0:5045d2638c29 40 word32 Y[16];
toddouska 0:5045d2638c29 41 word32 counter1024; /* counter1024 = i mod 1024 at the ith step */
toddouska 0:5045d2638c29 42 word32 key[8];
toddouska 0:5045d2638c29 43 word32 iv[8];
toddouska 0:5045d2638c29 44 } HC128;
toddouska 0:5045d2638c29 45
toddouska 0:5045d2638c29 46
toddouska 0:5045d2638c29 47 void Hc128_Process(HC128*, byte*, const byte*, word32);
toddouska 0:5045d2638c29 48 void Hc128_SetKey(HC128*, const byte* key, const byte* iv);
toddouska 0:5045d2638c29 49
toddouska 0:5045d2638c29 50
toddouska 0:5045d2638c29 51 #ifdef __cplusplus
toddouska 0:5045d2638c29 52 } /* extern "C" */
toddouska 0:5045d2638c29 53 #endif
toddouska 0:5045d2638c29 54
toddouska 0:5045d2638c29 55 #endif /* CTAO_CRYPT_HC128_H */
toddouska 0:5045d2638c29 56
toddouska 0:5045d2638c29 57 #endif /* NO_HC128 */