Prototype implementation of IKE key exchange via NTRU encryption
[strongswan.git] / src / libstrongswan / plugins / ntru / ntru_crypto / ntru_crypto_hash_basics.h
1 /******************************************************************************
2 * NTRU Cryptography Reference Source Code
3 * Copyright (c) 2009-2013, by Security Innovation, Inc. All rights reserved.
4 *
5 * ntru_crypto_hash_basics.c is a component of ntru-crypto.
6 *
7 * Copyright (C) 2009-2013 Security Innovation
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 *
23 *****************************************************************************/
24
25 /******************************************************************************
26 *
27 * File: ntru_crypto_hash_basics.h
28 *
29 * Contents: Common definitions for all hash algorithms.
30 *
31 *****************************************************************************/
32
33 #ifndef NTRU_CRYPTO_HASH_BASICS_H
34 #define NTRU_CRYPTO_HASH_BASICS_H
35
36 #include "ntru_crypto_platform.h"
37
38
39 /**************
40 * algorithms *
41 **************/
42
43 typedef enum {
44 NTRU_CRYPTO_HASH_ALGID_NONE = 0,
45 NTRU_CRYPTO_HASH_ALGID_SHA1,
46 NTRU_CRYPTO_HASH_ALGID_SHA256,
47 } NTRU_CRYPTO_HASH_ALGID;
48
49
50 /***************
51 * error codes *
52 ***************/
53
54 #define NTRU_CRYPTO_HASH_OK ((uint32_t)0x00)
55 #define NTRU_CRYPTO_HASH_FAIL ((uint32_t)0x01)
56 #define NTRU_CRYPTO_HASH_BAD_PARAMETER ((uint32_t)0x02)
57 #define NTRU_CRYPTO_HASH_OVERFLOW ((uint32_t)0x03)
58 #define NTRU_CRYPTO_HASH_BAD_ALG ((uint32_t)0x20)
59 #define NTRU_CRYPTO_HASH_OUT_OF_MEMORY ((uint32_t)0x21)
60
61 // For backward-compatibility
62 typedef uint32_t NTRU_CRYPTO_HASH_ERROR;
63
64
65 /*********
66 * flags *
67 *********/
68
69 #define HASH_DATA_ONLY 0
70 #define HASH_INIT (1 << 0)
71 #define HASH_FINISH (1 << 1)
72 #define HASH_ZERO_PAD (1 << 2)
73
74
75 #endif /* NTRU_CRYPTO_HASH_BASICS_H */