1
0

ctc_hc128.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* ctc_hc128.h
  2. *
  3. * Copyright (C) 2006-2011 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. #ifndef NO_HC128
  22. #ifndef CTAO_CRYPT_HC128_H
  23. #define CTAO_CRYPT_HC128_H
  24. #include "ctc_types.h"
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* HC-128 stream cipher */
  29. typedef struct HC128 {
  30. word32 T[1024]; /* P[i] = T[i]; Q[i] = T[1024 + i ]; */
  31. word32 X[16];
  32. word32 Y[16];
  33. word32 counter1024; /* counter1024 = i mod 1024 at the ith step */
  34. word32 key[8];
  35. word32 iv[8];
  36. } HC128;
  37. CYASSL_API void Hc128_Process(HC128*, byte*, const byte*, word32);
  38. CYASSL_API void Hc128_SetKey(HC128*, const byte* key, const byte* iv);
  39. #ifdef __cplusplus
  40. } /* extern "C" */
  41. #endif
  42. #endif /* CTAO_CRYPT_HC128_H */
  43. #endif /* NO_HC128 */