[BACK]Return to rijndael.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Annotation of src/usr.bin/ssh/rijndael.h, Revision 1.9

1.9     ! stevesk     1: /*     $OpenBSD: rijndael.h,v 1.8 2001/05/09 23:01:31 markus Exp $     */
1.7       deraadt     2:
                      3: /* This is an independent implementation of the encryption algorithm:   */
                      4: /*                                                                      */
                      5: /*         RIJNDAEL by Joan Daemen and Vincent Rijmen                   */
                      6: /*                                                                      */
                      7: /* which is a candidate algorithm in the Advanced Encryption Standard   */
                      8: /* programme of the US National Institute of Standards and Technology.  */
1.9     ! stevesk     9:
        !            10: /*
        !            11:    -----------------------------------------------------------------------
        !            12:    Copyright (c) 2001 Dr Brian Gladman <brg@gladman.uk.net>, Worcester, UK
        !            13:
        !            14:    TERMS
        !            15:
        !            16:    Redistribution and use in source and binary forms, with or without
        !            17:    modification, are permitted provided that the following conditions
        !            18:    are met:
        !            19:    1. Redistributions of source code must retain the above copyright
        !            20:       notice, this list of conditions and the following disclaimer.
        !            21:    2. Redistributions in binary form must reproduce the above copyright
        !            22:       notice, this list of conditions and the following disclaimer in the
        !            23:       documentation and/or other materials provided with the distribution.
        !            24:
        !            25:    This software is provided 'as is' with no guarantees of correctness or
        !            26:    fitness for purpose.
        !            27:    -----------------------------------------------------------------------
        !            28: */
1.6       niklas     29:
1.3       markus     30: #ifndef _RIJNDAEL_H_
                     31: #define _RIJNDAEL_H_
1.1       markus     32:
1.3       markus     33: /* 1. Standard types for AES cryptography source code               */
                     34:
1.5       markus     35: typedef u_int8_t   u1byte; /* an 8 bit unsigned character type */
                     36: typedef u_int16_t  u2byte; /* a 16 bit unsigned integer type   */
                     37: typedef u_int32_t  u4byte; /* a 32 bit unsigned integer type   */
1.3       markus     38:
                     39: typedef int8_t     s1byte; /* an 8 bit signed character type   */
                     40: typedef int16_t    s2byte; /* a 16 bit signed integer type     */
                     41: typedef int32_t    s4byte; /* a 32 bit signed integer type     */
                     42:
                     43: typedef struct _rijndael_ctx {
                     44:        u4byte  k_len;
                     45:        int decrypt;
                     46:        u4byte  e_key[64];
                     47:        u4byte  d_key[64];
                     48: } rijndael_ctx;
                     49:
                     50:
                     51: /* 2. Standard interface for AES cryptographic routines             */
                     52:
1.5       markus     53: /* These are all based on 32 bit unsigned values and will therefore */
1.3       markus     54: /* require endian conversions for big-endian architectures          */
                     55:
1.8       markus     56: rijndael_ctx *
                     57: rijndael_set_key __P((rijndael_ctx *, const u4byte *, const u4byte, int));
1.3       markus     58: void rijndael_encrypt __P((rijndael_ctx *, const u4byte *, u4byte *));
                     59: void rijndael_decrypt __P((rijndael_ctx *, const u4byte *, u4byte *));
                     60:
                     61: #endif /* _RIJNDAEL_H_ */