The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/crypto/rijndael/rijndael-api.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $KAME: rijndael.c,v 1.3 2003/08/28 14:20:22 itojun Exp $        */
    2 
    3 /*
    4  * rijndael-alg-fst.c
    5  *
    6  * @version 3.0 (December 2000)
    7  *
    8  * Optimised ANSI C code for the Rijndael cipher (now AES)
    9  *
   10  * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
   11  * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
   12  * @author Paulo Barreto <paulo.barreto@terra.com.br>
   13  *
   14  * This code is hereby placed in the public domain.
   15  *
   16  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
   17  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
   20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
   23  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
   25  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
   26  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   27  */
   28 
   29 #include <sys/cdefs.h>
   30 __FBSDID("$FreeBSD: releng/9.2/sys/crypto/rijndael/rijndael-api.c 175360 2008-01-15 18:34:47Z sobomax $");
   31 
   32 #include <sys/types.h>
   33 #ifdef _KERNEL
   34 #include <sys/systm.h>
   35 #endif
   36 
   37 #include <crypto/rijndael/rijndael.h>
   38 
   39 void
   40 rijndael_set_key(rijndael_ctx *ctx, const u_char *key, int bits)
   41 {
   42 
   43         ctx->Nr = rijndaelKeySetupEnc(ctx->ek, key, bits);
   44         rijndaelKeySetupDec(ctx->dk, key, bits);
   45 }
   46 
   47 void
   48 rijndael_decrypt(const rijndael_ctx *ctx, const u_char *src, u_char *dst)
   49 {
   50 
   51         rijndaelDecrypt(ctx->dk, ctx->Nr, src, dst);
   52 }
   53 
   54 void
   55 rijndael_encrypt(const rijndael_ctx *ctx, const u_char *src, u_char *dst)
   56 {
   57 
   58         rijndaelEncrypt(ctx->ek, ctx->Nr, src, dst);
   59 }

Cache object: eacbc950d1e84d1f85fab76457550e8f


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.