1*ebfedea0SLionel Sambuc /* $NetBSD: rijndael-alg-fst.h,v 1.1.1.1 2011/04/13 18:14:51 elric Exp $ */ 2*ebfedea0SLionel Sambuc 3*ebfedea0SLionel Sambuc /* NetBSD: rijndael-alg-fst.h,v 1.2 2000/10/02 17:19:15 itojun Exp */ 4*ebfedea0SLionel Sambuc /* $KAME: rijndael-alg-fst.h,v 1.5 2003/07/15 10:47:16 itojun Exp $ */ 5*ebfedea0SLionel Sambuc /** 6*ebfedea0SLionel Sambuc * rijndael-alg-fst.h 7*ebfedea0SLionel Sambuc * 8*ebfedea0SLionel Sambuc * @version 3.0 (December 2000) 9*ebfedea0SLionel Sambuc * 10*ebfedea0SLionel Sambuc * Optimised ANSI C code for the Rijndael cipher (now AES) 11*ebfedea0SLionel Sambuc * 12*ebfedea0SLionel Sambuc * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be> 13*ebfedea0SLionel Sambuc * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be> 14*ebfedea0SLionel Sambuc * @author Paulo Barreto <paulo.barreto@terra.com.br> 15*ebfedea0SLionel Sambuc * 16*ebfedea0SLionel Sambuc * This code is hereby placed in the public domain. 17*ebfedea0SLionel Sambuc * 18*ebfedea0SLionel Sambuc * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS 19*ebfedea0SLionel Sambuc * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20*ebfedea0SLionel Sambuc * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21*ebfedea0SLionel Sambuc * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE 22*ebfedea0SLionel Sambuc * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23*ebfedea0SLionel Sambuc * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24*ebfedea0SLionel Sambuc * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 25*ebfedea0SLionel Sambuc * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26*ebfedea0SLionel Sambuc * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 27*ebfedea0SLionel Sambuc * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 28*ebfedea0SLionel Sambuc * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29*ebfedea0SLionel Sambuc */ 30*ebfedea0SLionel Sambuc #ifndef __RIJNDAEL_ALG_FST_H 31*ebfedea0SLionel Sambuc #define __RIJNDAEL_ALG_FST_H 32*ebfedea0SLionel Sambuc 33*ebfedea0SLionel Sambuc /* symbol renaming */ 34*ebfedea0SLionel Sambuc #define rijndaelKeySetupEnc _hc_rijndaelKeySetupEnc 35*ebfedea0SLionel Sambuc #define rijndaelKeySetupDec _hc_rijndaelKeySetupDec 36*ebfedea0SLionel Sambuc #define rijndaelEncrypt _hc_rijndaelEncrypt 37*ebfedea0SLionel Sambuc #define rijndaelDecrypt _hc_rijndaelDecrypt 38*ebfedea0SLionel Sambuc 39*ebfedea0SLionel Sambuc #define RIJNDAEL_MAXKC (256/32) 40*ebfedea0SLionel Sambuc #define RIJNDAEL_MAXKB (256/8) 41*ebfedea0SLionel Sambuc #define RIJNDAEL_MAXNR 14 42*ebfedea0SLionel Sambuc 43*ebfedea0SLionel Sambuc int rijndaelKeySetupEnc(uint32_t rk[/*4*(Nr + 1)*/], const uint8_t cipherKey[], int keyBits); 44*ebfedea0SLionel Sambuc int rijndaelKeySetupDec(uint32_t rk[/*4*(Nr + 1)*/], const uint8_t cipherKey[], int keyBits); 45*ebfedea0SLionel Sambuc void rijndaelEncrypt(const uint32_t rk[/*4*(Nr + 1)*/], int Nr, const uint8_t pt[16], uint8_t ct[16]); 46*ebfedea0SLionel Sambuc void rijndaelDecrypt(const uint32_t rk[/*4*(Nr + 1)*/], int Nr, const uint8_t ct[16], uint8_t pt[16]); 47*ebfedea0SLionel Sambuc 48*ebfedea0SLionel Sambuc #endif /* __RIJNDAEL_ALG_FST_H */ 49