xtea.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef _XTEA_H_
  2. #define _XTEA_H_
  3. /*
  4. * Copyright of XTEA encryption algorithm by David Wheeler and Roger Needham
  5. * at the Computer Laboratory of Cambridge University.
  6. *
  7. * Kindly released to Public Domain.
  8. */
  9. /*
  10. * Copyright of Implementation 2010 by Ulrich Prinz (uprinz2@netscape.net)
  11. *
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions
  16. * are met:
  17. *
  18. * 1. Redistributions of source code must retain the above copyright
  19. * notice, this list of conditions and the following disclaimer.
  20. * 2. Redistributions in binary form must reproduce the above copyright
  21. * notice, this list of conditions and the following disclaimer in the
  22. * documentation and/or other materials provided with the distribution.
  23. * 3. Neither the name of the copyright holders nor the names of
  24. * contributors may be used to endorse or promote products derived
  25. * from this software without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  28. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  29. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  30. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  31. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  32. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  33. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  34. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  35. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  36. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  37. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  38. * SUCH DAMAGE.
  39. *
  40. * For additional information see http://www.ethernut.de/
  41. */
  42. /*
  43. * \file gorp/crypt/xtea.h
  44. * \brief Fast and effcient Extended Tiny Encryption Algorythm.
  45. *
  46. * \verbatim
  47. * $Id$
  48. * \endverbatim
  49. */
  50. typedef uint32_t XTeaKeyBlock_t[4];
  51. extern void XTeaCrypt(uint32_t *w, const uint32_t *v, const XTeaKeyBlock_t k);
  52. extern void XTeaDecrypt(uint32_t *w, const uint32_t *v, const XTeaKeyBlock_t k);
  53. extern void XTeaCryptStr( char *dst, const char *src, uint16_t len, const char *pass);
  54. extern void XTeaDecryptStr( char * dst, const char *src, uint16_t len, const char *pass);
  55. #endif /* _XTEA_H_ */