]> andersk Git - openssh.git/blame_incremental - rijndael.h
- stevesk@cvs.openbsd.org 2001/09/12 18:18:25
[openssh.git] / rijndael.h
... / ...
CommitLineData
1/* $OpenBSD: rijndael.h,v 1.9 2001/07/30 16:23:30 stevesk Exp $ */
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. */
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*/
29
30#ifndef _RIJNDAEL_H_
31#define _RIJNDAEL_H_
32
33#include "config.h"
34
35/* 1. Standard types for AES cryptography source code */
36
37typedef u_int8_t u1byte; /* an 8 bit unsigned character type */
38typedef u_int16_t u2byte; /* a 16 bit unsigned integer type */
39typedef u_int32_t u4byte; /* a 32 bit unsigned integer type */
40
41typedef int8_t s1byte; /* an 8 bit signed character type */
42typedef int16_t s2byte; /* a 16 bit signed integer type */
43typedef int32_t s4byte; /* a 32 bit signed integer type */
44
45typedef struct _rijndael_ctx {
46 u4byte k_len;
47 int decrypt;
48 u4byte e_key[64];
49 u4byte d_key[64];
50} rijndael_ctx;
51
52
53/* 2. Standard interface for AES cryptographic routines */
54
55/* These are all based on 32 bit unsigned values and will therefore */
56/* require endian conversions for big-endian architectures */
57
58rijndael_ctx *
59rijndael_set_key __P((rijndael_ctx *, const u4byte *, const u4byte, int));
60void rijndael_encrypt __P((rijndael_ctx *, const u4byte *, u4byte *));
61void rijndael_decrypt __P((rijndael_ctx *, const u4byte *, u4byte *));
62
63#endif /* _RIJNDAEL_H_ */
This page took 0.045028 seconds and 5 git commands to generate.