sha3_224.h
Go to the documentation of this file.
1 /**
2  * @file sha3_224.h
3  * @brief SHA3-224 hash function (SHA-3 with 224-bit output)
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneCrypto Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _SHA3_224_H
30 #define _SHA3_224_H
31 
32 //Dependencies
33 #include "core/crypto.h"
34 #include "xof/keccak.h"
35 
36 //SHA3-224 block size
37 #define SHA3_224_BLOCK_SIZE 144
38 //SHA3-224 digest size
39 #define SHA3_224_DIGEST_SIZE 28
40 //SHA3-224 algorithm object identifier
41 #define SHA3_224_OID sha3_224Oid
42 //Common interface for hash algorithms
43 #define SHA3_224_HASH_ALGO (&sha3_224HashAlgo)
44 
45 //C++ guard
46 #ifdef __cplusplus
47  extern "C" {
48 #endif
49 
50 
51 /**
52  * @brief SHA3-224 algorithm context
53  **/
54 
56 
57 
58 //SHA3-224 related constants
59 extern const uint8_t sha3_224Oid[9];
60 extern const HashAlgo sha3_224HashAlgo;
61 
62 //SHA3-224 related functions
63 error_t sha3_224Compute(const void *data, size_t length, uint8_t *digest);
64 void sha3_224Init(Sha3_224Context *context);
65 void sha3_224Update(Sha3_224Context *context, const void *data, size_t length);
66 void sha3_224Final(Sha3_224Context *context, uint8_t *digest);
67 
68 //C++ guard
69 #ifdef __cplusplus
70  }
71 #endif
72 
73 #endif
General definitions for cryptographic algorithms.
Keccak sponge function.
Keccak context.
Definition: keccak.h:105
error_t sha3_224Compute(const void *data, size_t length, uint8_t *digest)
Digest a message using SHA3-224.
Definition: sha3_224.c:71
void sha3_224Update(Sha3_224Context *context, const void *data, size_t length)
Update the SHA3-224 context with a portion of the message being hashed.
Definition: sha3_224.c:114
void sha3_224Final(Sha3_224Context *context, uint8_t *digest)
Finish the SHA3-224 message digest.
Definition: sha3_224.c:127
const HashAlgo sha3_224HashAlgo
Definition: sha3_224.c:48
const uint8_t sha3_224Oid[9]
Definition: sha3_224.c:45
error_t
Error codes.
Definition: error.h:40
void sha3_224Init(Sha3_224Context *context)
Initialize SHA3-224 message digest context.
Definition: sha3_224.c:100
uint8_t data[]
Definition: dtls_misc.h:167
Common interface for hash algorithms.
Definition: crypto.h:1054
uint8_t length
Definition: dtls_misc.h:140
KeccakContext Sha3_224Context
SHA3-224 algorithm context.
Definition: sha3_224.h:55