rijndael-alg-fst.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * rijndael-alg-fst.h
  3. *
  4. * @version 3.0 (December 2000)
  5. *
  6. * Optimised ANSI C code for the Rijndael cipher (now AES)
  7. *
  8. * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
  9. * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
  10. * @author Paulo Barreto <paulo.barreto@terra.com.br>
  11. *
  12. * This code is hereby placed in the public domain.
  13. *
  14. * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
  15. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  17. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
  18. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  19. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  20. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  21. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  22. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  23. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  24. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. #ifndef RIJNDAEL_ALG_FST_H
  27. #define RIJNDAEL_ALG_FST_H
  28. #define MAXKC (256/32)
  29. #define MAXKB (256/8)
  30. #define MAXNR 14
  31. typedef unsigned char u8;
  32. typedef unsigned short u16;
  33. typedef unsigned int u32;
  34. int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits);
  35. int rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits);
  36. void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16], u8 ct[16]);
  37. void rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16], u8 pt[16]);
  38. #ifdef INTERMEDIATE_VALUE_KAT
  39. void rijndaelEncryptRound(const u32 rk[/*4*(Nr + 1)*/], int Nr, u8 block[16], int rounds);
  40. void rijndaelDecryptRound(const u32 rk[/*4*(Nr + 1)*/], int Nr, u8 block[16], int rounds);
  41. #endif /* INTERMEDIATE_VALUE_KAT */
  42. #endif /* RIJNDAEL_ALG_FST_H */