00001 #ifndef _XTEA_H_ 00002 #define _XTEA_H_ 00003 /* 00004 * Copyright of XTEA encryption algorithm by David Wheeler and Roger Needham 00005 * at the Computer Laboratory of Cambridge University. 00006 * 00007 * Kindly released to Public Domain. 00008 */ 00009 00010 /* 00011 * Copyright of Implementation 2010 by Ulrich Prinz (uprinz2@netscape.net) 00012 * 00013 * All rights reserved. 00014 * 00015 * Redistribution and use in source and binary forms, with or without 00016 * modification, are permitted provided that the following conditions 00017 * are met: 00018 * 00019 * 1. Redistributions of source code must retain the above copyright 00020 * notice, this list of conditions and the following disclaimer. 00021 * 2. Redistributions in binary form must reproduce the above copyright 00022 * notice, this list of conditions and the following disclaimer in the 00023 * documentation and/or other materials provided with the distribution. 00024 * 3. Neither the name of the copyright holders nor the names of 00025 * contributors may be used to endorse or promote products derived 00026 * from this software without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00029 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00030 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00031 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00032 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00033 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00034 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00035 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00036 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00037 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00038 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00039 * SUCH DAMAGE. 00040 * 00041 * For additional information see http://www.ethernut.de/ 00042 */ 00043 00044 /* 00045 * \file gorp/crypt/xtea.h 00046 * \brief Fast and effcient Extended Tiny Encryption Algorythm. 00047 * 00048 * \verbatim 00049 * $Id$ 00050 * \endverbatim 00051 */ 00052 00053 00054 typedef uint32_t XTeaKeyBlock_t[4]; 00055 00056 extern void XTeaCrypt(uint32_t *w, CONST uint32_t *v, CONST XTeaKeyBlock_t k); 00057 extern void XTeaDecrypt(uint32_t *w, CONST uint32_t *v, CONST XTeaKeyBlock_t k); 00058 00059 extern void XTeaCryptStr( char *dst, CONST char *src, uint16_t len, CONST char *pass); 00060 extern void XTeaDecryptStr( char * dst, CONST char *src, uint16_t len, CONST char *pass); 00061 00062 #endif /* _XTEA_H_ */