scal_rabbit.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* scal_rabbit.c */
  2. /*
  3. This file is part of the ARM-Crypto-Lib.
  4. Copyright (C) 2011 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. #include <stdlib.h>
  17. #include <stdint.h>
  18. #include <crypto/streamcipher_descriptor.h>
  19. #include <crypto/keysize_descriptor.h>
  20. #include <crypto/rabbit.h>
  21. const char rabbit_str[] = "Rabbit";
  22. const uint8_t rabbit_keysize_desc[] = {
  23. KS_TYPE_LIST, 2, KS_INT(128), KS_INT(80),
  24. KS_TYPE_TERMINATOR };
  25. const uint8_t rabbit_ivsize_desc[] = {
  26. KS_TYPE_LIST, 1, KS_INT(64),
  27. KS_TYPE_TERMINATOR };
  28. const scdesc_t rabbit_desc = {
  29. SCDESC_TYPE_STREAMCIPHER, /* abstraction layer type designator */
  30. SC_INIT_TYPE_4|SC_GEN_TYPE_1, /* flags*/
  31. rabbit_str, /* name string pointer */
  32. sizeof(rabbit_ctx_t), /* size of context */
  33. 8, /* blocksize */
  34. {(void_fpt)rabbit_init}, /* init function pointer */
  35. {(void_fpt)rabbit_gen}, /* key stream generator function pointer */
  36. {(void_fpt)NULL}, /* key stream generator for random access function pointer */
  37. (sc_free_fpt)NULL, /* free function pointer */
  38. rabbit_keysize_desc, /* key size descriptor pointer */
  39. rabbit_ivsize_desc /* iv size descriptor pointer */
  40. };