1*a03ec00cSchristos /* $NetBSD: rijndael.h,v 1.3 2022/02/23 19:07:20 christos Exp $ */ 2*a03ec00cSchristos /* $OpenBSD: rijndael.h,v 1.15 2021/09/28 11:14:50 dtucker Exp $ */ 35484a5efSchristos 45484a5efSchristos /** 55484a5efSchristos * rijndael-alg-fst.h 65484a5efSchristos * 75484a5efSchristos * @version 3.0 (December 2000) 85484a5efSchristos * 95484a5efSchristos * Optimised ANSI C code for the Rijndael cipher (now AES) 105484a5efSchristos * 115484a5efSchristos * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be> 125484a5efSchristos * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be> 135484a5efSchristos * @author Paulo Barreto <paulo.barreto@terra.com.br> 145484a5efSchristos * 155484a5efSchristos * This code is hereby placed in the public domain. 165484a5efSchristos * 175484a5efSchristos * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS 185484a5efSchristos * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 195484a5efSchristos * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 205484a5efSchristos * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE 215484a5efSchristos * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 225484a5efSchristos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 235484a5efSchristos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 245484a5efSchristos * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 255484a5efSchristos * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 265484a5efSchristos * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 275484a5efSchristos * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 285484a5efSchristos */ 295484a5efSchristos #ifndef _PRIVATE_RIJNDAEL_H 305484a5efSchristos #define _PRIVATE_RIJNDAEL_H 315484a5efSchristos 325484a5efSchristos #define AES_MAXKEYBITS (256) 335484a5efSchristos #define AES_MAXKEYBYTES (AES_MAXKEYBITS/8) 345484a5efSchristos /* for 256-bit keys, fewer for less */ 355484a5efSchristos #define AES_MAXROUNDS 14 365484a5efSchristos 375484a5efSchristos typedef unsigned char u8; 385484a5efSchristos typedef unsigned short u16; 395484a5efSchristos typedef unsigned int u32; 405484a5efSchristos 415484a5efSchristos int rijndaelKeySetupEnc(unsigned int [], const unsigned char [], int); 42*a03ec00cSchristos void rijndaelEncrypt(const unsigned int [], int, const u8 [16], u8 [16]); 435484a5efSchristos 445484a5efSchristos #endif /* _PRIVATE_RIJNDAEL_H */ 45