ctc_rabbit.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* ctc_rabbit.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_RABBIT
  22. #ifndef CTAO_CRYPT_RABBIT_H
  23. #define CTAO_CRYPT_RABBIT_H
  24. #include "ctc_types.h"
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* Rabbit Context */
  29. typedef struct RabbitCtx {
  30. word32 x[8];
  31. word32 c[8];
  32. word32 carry;
  33. } RabbitCtx;
  34. /* Rabbit stream cipher */
  35. typedef struct Rabbit {
  36. RabbitCtx masterCtx;
  37. RabbitCtx workCtx;
  38. } Rabbit;
  39. CYASSL_API void RabbitProcess(Rabbit*, byte*, const byte*, word32);
  40. CYASSL_API void RabbitSetKey(Rabbit*, const byte* key, const byte* iv);
  41. #ifdef __cplusplus
  42. } /* extern "C" */
  43. #endif
  44. #endif /* CTAO_CRYPT_RABBIT_H */
  45. #endif /* NO_RABBIT */