aes_keyschedule.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* aes_keyschedule.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 aes_keyschedule.h
  18. * \email daniel.otte@rub.de
  19. * \author Daniel Otte
  20. * \date 2008-12-30
  21. * \license GPLv3 or later
  22. * \ingroup AES
  23. */
  24. #ifndef AES_KEYSCHEDULE_H_
  25. #define AES_KEYSCHEDULE_H_
  26. #include <crypto/aes_types.h>
  27. /**
  28. * \brief initialize the keyschedule
  29. *
  30. * This function computes the keyschedule from a given key with a given length
  31. * and stores it in the context variable
  32. * \param key pointer to the key material
  33. * \param keysize_b length of the key in bits (valid are 128, 192 and 256)
  34. * \param ctx pointer to the context where the keyschedule should be stored
  35. */
  36. void aes_init(const void* key, uint16_t keysize_b, aes_genctx_t* ctx);
  37. /**
  38. * \brief initialize the keyschedule for 128 bit key
  39. *
  40. * This function computes the keyschedule from a given 128 bit key
  41. * and stores it in the context variable
  42. * \param key pointer to the key material
  43. * \param ctx pointer to the context where the keyschedule should be stored
  44. */
  45. void aes128_init(const void* key, aes128_ctx_t* ctx);
  46. /**
  47. * \brief initialize the keyschedule for 192 bit key
  48. *
  49. * This function computes the keyschedule from a given 192 bit key
  50. * and stores it in the context variable
  51. * \param key pointer to the key material
  52. * \param ctx pointer to the context where the keyschedule should be stored
  53. */
  54. void aes192_init(const void* key, aes192_ctx_t* ctx);
  55. /**
  56. * \brief initialize the keyschedule for 256 bit key
  57. *
  58. * This function computes the keyschedule from a given 256 bit key
  59. * and stores it in the context variable
  60. * \param key pointer to the key material
  61. * \param ctx pointer to the context where the keyschedule should be stored
  62. */
  63. void aes256_init(const void* key, aes256_ctx_t* ctx);
  64. #endif /* AES_KEYSCHEDULE_H_ */