rijndael.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef RIJNDAEL_INCLUDED
  2. #define RIJNDAEL_INCLUDED
  3. /* Copyright (c) 2002, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
  4. Use is subject to license terms.
  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; version 2 of the License.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  15. /*
  16. rijndael-alg-fst.h
  17. @version 3.0 (December 2000)
  18. Optimised ANSI C code for the Rijndael cipher (now AES)
  19. @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
  20. @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
  21. @author Paulo Barreto <paulo.barreto@terra.com.br>
  22. This code is hereby placed in the public domain.
  23. Modified by Peter Zaitsev to fit MySQL coding style.
  24. */
  25. #define AES_MAXKC (256/32)
  26. #define AES_MAXKB (256/8)
  27. #define AES_MAXNR 14
  28. int rijndaelKeySetupEnc(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[],
  29. int keyBits);
  30. int rijndaelKeySetupDec(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[],
  31. int keyBits);
  32. void rijndaelEncrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr,
  33. const uint8 pt[16], uint8 ct[16]);
  34. void rijndaelDecrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr,
  35. const uint8 ct[16], uint8 pt[16]);
  36. #endif /* RIJNDAEL_INCLUDED */