~ubuntu-branches/ubuntu/trusty/pdns/trusty-security

« back to all changes in this revision

Viewing changes to pdns/ext/polarssl/include/polarssl/xtea.h

  • Committer: Package Import Robot
  • Author(s): Marc Haber, Marc Haber, Evgeni Golov
  • Date: 2012-05-11 23:51:27 UTC
  • mfrom: (1.1.9) (12.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20120511235127-v0qjuaplfckcb2cd
Tags: 3.1-1
[ Marc Haber ]
* Imported Upstream version 3.1
  * reduce column size for 'algorithm' to 50. Closes: #662935
  * handle smallcaps RRs. Closes: #656788
* refresh patches
* remove unused patches
* add patch to turn off the traceback handler at run time
* add patch for changeset 2575 (race condition with supermasters)
* fix mysql multiarch build failure, set cflags etc to hardening defaults
* do not run bootstrap a build time, using autotools_dev
* use dh-autoreconf, remove autofoo created files from
  patches/fix-mongodb-backend-patch
* fix dh invocation
* create MySQL databases with engine=innodb instead of type
* set debian/compat to 9
* Standards-Version: 3.9.3 (no changes needed)
* add myself to uploaders, change Vcs-Header to my git. Closes: #672550

[ Evgeni Golov ]
* use system libpolarssl if present, local copy otherwise.
  Closes: #671856, #656861

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * \file xtea.h
3
 
 *
4
 
 *  Copyright (C) 2006-2010, Paul Bakker <polarssl_maintainer at polarssl.org>
5
 
 *  All rights reserved.
6
 
 *
7
 
 *  This program is free software; you can redistribute it and/or modify
8
 
 *  it under the terms of the GNU General Public License as published by
9
 
 *  the Free Software Foundation; either version 2 of the License, or
10
 
 *  (at your option) any later version.
11
 
 *
12
 
 *  This program is distributed in the hope that it will be useful,
13
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 *  GNU General Public License for more details.
16
 
 *
17
 
 *  You should have received a copy of the GNU General Public License along
18
 
 *  with this program; if not, write to the Free Software Foundation, Inc.,
19
 
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
 
 */
21
 
#ifndef POLARSSL_XTEA_H
22
 
#define POLARSSL_XTEA_H
23
 
 
24
 
#ifdef _MSC_VER
25
 
#include <basetsd.h>
26
 
typedef UINT32 uint32_t;
27
 
#else
28
 
#include <inttypes.h>
29
 
#endif
30
 
 
31
 
#define XTEA_ENCRYPT     1
32
 
#define XTEA_DECRYPT     0
33
 
 
34
 
 
35
 
/**
36
 
 * \brief          XTEA context structure
37
 
 */
38
 
typedef struct
39
 
{
40
 
    uint32_t k[4];       /*!< key */
41
 
}
42
 
xtea_context;
43
 
 
44
 
#ifdef __cplusplus
45
 
extern "C" {
46
 
#endif
47
 
 
48
 
/**
49
 
 * \brief          XTEA key schedule
50
 
 *
51
 
 * \param ctx      XTEA context to be initialized
52
 
 * \param key      the secret key
53
 
 */
54
 
void xtea_setup( xtea_context *ctx, unsigned char key[16] );
55
 
 
56
 
/**
57
 
 * \brief          XTEA cipher function
58
 
 *
59
 
 * \param ctx      XTEA context
60
 
 * \param mode     XTEA_ENCRYPT or XTEA_DECRYPT
61
 
 * \param input    8-byte input block
62
 
 * \param output   8-byte output block
63
 
 *
64
 
 * \return         0 if successful
65
 
 */
66
 
int xtea_crypt_ecb( xtea_context *ctx,
67
 
                 int mode,
68
 
                 unsigned char input[8],
69
 
                 unsigned char output[8] );
70
 
 
71
 
/*
72
 
 * \brief          Checkup routine
73
 
 *
74
 
 * \return         0 if successful, or 1 if the test failed
75
 
 */
76
 
int xtea_self_test( int verbose );
77
 
 
78
 
#ifdef __cplusplus
79
 
}
80
 
#endif
81
 
 
82
 
#endif /* xtea.h */