rc6.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* rc6.h */
  2. /*
  3. This file is part of the ARM-Crypto-Lib.
  4. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de)
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. /*
  17. * File: rc6.h
  18. * Author: Daniel Otte
  19. * Date: 06.08.2006
  20. * License: GPL
  21. * Description: Implementation of the RC6 cipher algorithm.
  22. * This implementation is restricted to 32-bit words, but free in the choice of number of rounds (0 to 255).
  23. * so it is RC6-32/r/b
  24. */
  25. #ifndef RC6_H_
  26. #define RC6_H_
  27. #include <stdint.h>
  28. typedef struct rc6_ctx_st{
  29. uint8_t rounds; /* specifies the number of rounds; default: 20 */
  30. uint32_t* S; /* the round-keys */
  31. } rc6_ctx_t;
  32. void rc6_init(const void* key, uint16_t keylength_b, rc6_ctx_t *s);
  33. uint8_t rc6_initl(const void* key, uint16_t keylength_b, uint8_t rounds, rc6_ctx_t *s);
  34. void rc6_enc(void* block, rc6_ctx_t *s);
  35. void rc6_dec(void* block, rc6_ctx_t *s);
  36. void rc6_free(rc6_ctx_t *s);
  37. #endif /* RC6_H_ */