Home | History | Annotate | Line # | Download | only in cast128
cast128.h revision 1.3.2.3
      1  1.3.2.3  bouyer /*	$NetBSD: cast128.h,v 1.3.2.3 2000/11/22 16:03:05 bouyer Exp $	*/
      2  1.3.2.3  bouyer /*	$KAME: cast128.h,v 1.6 2000/09/18 20:59:20 itojun Exp $	*/
      3  1.3.2.2  bouyer 
      4  1.3.2.2  bouyer /*
      5  1.3.2.2  bouyer  * heavily modified by Tomomi Suzuki <suzuki (at) grelot.elec.ryukoku.ac.jp>
      6  1.3.2.2  bouyer  */
      7  1.3.2.2  bouyer /*
      8  1.3.2.2  bouyer  * The CAST-128 Encryption Algorithm (RFC 2144)
      9  1.3.2.2  bouyer  *
     10  1.3.2.2  bouyer  * original implementation <Hideo "Sir MaNMOS" Morisita>
     11  1.3.2.2  bouyer  * 1997/08/21
     12  1.3.2.2  bouyer  */
     13  1.3.2.2  bouyer /*
     14  1.3.2.2  bouyer  * Copyright (C) 1997 Hideo "Sir MANMOS" Morishita
     15  1.3.2.2  bouyer  * All rights reserved.
     16  1.3.2.2  bouyer  *
     17  1.3.2.2  bouyer  * Redistribution and use in source and binary forms, with or without
     18  1.3.2.2  bouyer  * modification, are permitted provided that the following conditions
     19  1.3.2.2  bouyer  * are met:
     20  1.3.2.2  bouyer  * 1. Redistributions of source code must retain the above copyright
     21  1.3.2.2  bouyer  *    notice, this list of conditions and the following disclaimer.
     22  1.3.2.2  bouyer  * 2. Redistributions in binary form must reproduce the above copyright
     23  1.3.2.2  bouyer  *    notice, this list of conditions and the following disclaimer in the
     24  1.3.2.2  bouyer  *    documentation and/or other materials provided with the distribution.
     25  1.3.2.2  bouyer  *
     26  1.3.2.2  bouyer  * THIS SOFTWARE IS PROVIDED BY Hideo "Sir MaNMOS" Morishita ``AS IS'' AND
     27  1.3.2.2  bouyer  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     28  1.3.2.2  bouyer  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     29  1.3.2.2  bouyer  * ARE DISCLAIMED.  IN NO EVENT SHALL Hideo "Sir MaNMOS" Morishita BE LIABLE
     30  1.3.2.2  bouyer  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     31  1.3.2.2  bouyer  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     32  1.3.2.2  bouyer  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     33  1.3.2.2  bouyer  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     34  1.3.2.2  bouyer  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     35  1.3.2.2  bouyer  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     36  1.3.2.2  bouyer  * SUCH DAMAGE.
     37  1.3.2.2  bouyer  */
     38  1.3.2.2  bouyer 
     39  1.3.2.2  bouyer #ifndef RFC2144_CAST_128_H
     40  1.3.2.2  bouyer #define RFC2144_CAST_128_H
     41  1.3.2.2  bouyer 
     42  1.3.2.2  bouyer #include <sys/param.h>
     43  1.3.2.2  bouyer 
     44  1.3.2.2  bouyer 
     45  1.3.2.2  bouyer #define	CAST128_ENCRYPT	1
     46  1.3.2.2  bouyer #define	CAST128_DECRYPT	0
     47  1.3.2.2  bouyer 
     48  1.3.2.2  bouyer 
     49  1.3.2.2  bouyer extern void set_cast128_subkey __P((u_int32_t *, u_int8_t *));
     50  1.3.2.2  bouyer extern void cast128_encrypt_round16 __P((u_int8_t *, const u_int8_t *,
     51  1.3.2.2  bouyer 					u_int32_t *));
     52  1.3.2.2  bouyer extern void cast128_decrypt_round16 __P((u_int8_t *, const u_int8_t *,
     53  1.3.2.2  bouyer 					u_int32_t *));
     54  1.3.2.2  bouyer extern void cast128_encrypt_round12 __P((u_int8_t *, const u_int8_t *,
     55  1.3.2.2  bouyer 					u_int32_t *));
     56  1.3.2.2  bouyer extern void cast128_decrypt_round12 __P((u_int8_t *, const u_int8_t *,
     57  1.3.2.2  bouyer 					u_int32_t *));
     58  1.3.2.2  bouyer #endif
     59  1.3.2.2  bouyer 
     60