Webserver+3d print
cyclone_crypto/sha3_384.h@0:8918a71cdbe9, 2017-02-04 (annotated)
- Committer:
- Sergunb
- Date:
- Sat Feb 04 18:15:49 2017 +0000
- Revision:
- 0:8918a71cdbe9
nothing else
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Sergunb | 0:8918a71cdbe9 | 1 | /** |
Sergunb | 0:8918a71cdbe9 | 2 | * @file sha3_384.h |
Sergunb | 0:8918a71cdbe9 | 3 | * @brief SHA3-384 hash function (SHA-3 with 384-bit output) |
Sergunb | 0:8918a71cdbe9 | 4 | * |
Sergunb | 0:8918a71cdbe9 | 5 | * @section License |
Sergunb | 0:8918a71cdbe9 | 6 | * |
Sergunb | 0:8918a71cdbe9 | 7 | * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved. |
Sergunb | 0:8918a71cdbe9 | 8 | * |
Sergunb | 0:8918a71cdbe9 | 9 | * This file is part of CycloneCrypto Open. |
Sergunb | 0:8918a71cdbe9 | 10 | * |
Sergunb | 0:8918a71cdbe9 | 11 | * This program is free software; you can redistribute it and/or |
Sergunb | 0:8918a71cdbe9 | 12 | * modify it under the terms of the GNU General Public License |
Sergunb | 0:8918a71cdbe9 | 13 | * as published by the Free Software Foundation; either version 2 |
Sergunb | 0:8918a71cdbe9 | 14 | * of the License, or (at your option) any later version. |
Sergunb | 0:8918a71cdbe9 | 15 | * |
Sergunb | 0:8918a71cdbe9 | 16 | * This program is distributed in the hope that it will be useful, |
Sergunb | 0:8918a71cdbe9 | 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Sergunb | 0:8918a71cdbe9 | 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Sergunb | 0:8918a71cdbe9 | 19 | * GNU General Public License for more details. |
Sergunb | 0:8918a71cdbe9 | 20 | * |
Sergunb | 0:8918a71cdbe9 | 21 | * You should have received a copy of the GNU General Public License |
Sergunb | 0:8918a71cdbe9 | 22 | * along with this program; if not, write to the Free Software Foundation, |
Sergunb | 0:8918a71cdbe9 | 23 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
Sergunb | 0:8918a71cdbe9 | 24 | * |
Sergunb | 0:8918a71cdbe9 | 25 | * @author Oryx Embedded SARL (www.oryx-embedded.com) |
Sergunb | 0:8918a71cdbe9 | 26 | * @version 1.7.6 |
Sergunb | 0:8918a71cdbe9 | 27 | **/ |
Sergunb | 0:8918a71cdbe9 | 28 | |
Sergunb | 0:8918a71cdbe9 | 29 | #ifndef _SHA3_384_H |
Sergunb | 0:8918a71cdbe9 | 30 | #define _SHA3_384_H |
Sergunb | 0:8918a71cdbe9 | 31 | |
Sergunb | 0:8918a71cdbe9 | 32 | //Dependencies |
Sergunb | 0:8918a71cdbe9 | 33 | #include "crypto.h" |
Sergunb | 0:8918a71cdbe9 | 34 | #include "keccak.h" |
Sergunb | 0:8918a71cdbe9 | 35 | |
Sergunb | 0:8918a71cdbe9 | 36 | //SHA3-384 block size |
Sergunb | 0:8918a71cdbe9 | 37 | #define SHA3_384_BLOCK_SIZE 104 |
Sergunb | 0:8918a71cdbe9 | 38 | //SHA3-384 digest size |
Sergunb | 0:8918a71cdbe9 | 39 | #define SHA3_384_DIGEST_SIZE 48 |
Sergunb | 0:8918a71cdbe9 | 40 | //Common interface for hash algorithms |
Sergunb | 0:8918a71cdbe9 | 41 | #define SHA3_384_HASH_ALGO (&sha3_384HashAlgo) |
Sergunb | 0:8918a71cdbe9 | 42 | |
Sergunb | 0:8918a71cdbe9 | 43 | |
Sergunb | 0:8918a71cdbe9 | 44 | /** |
Sergunb | 0:8918a71cdbe9 | 45 | * @brief SHA3-384 algorithm context |
Sergunb | 0:8918a71cdbe9 | 46 | **/ |
Sergunb | 0:8918a71cdbe9 | 47 | |
Sergunb | 0:8918a71cdbe9 | 48 | typedef KeccakContext Sha3_384Context; |
Sergunb | 0:8918a71cdbe9 | 49 | |
Sergunb | 0:8918a71cdbe9 | 50 | |
Sergunb | 0:8918a71cdbe9 | 51 | //SHA3-384 related constants |
Sergunb | 0:8918a71cdbe9 | 52 | extern const HashAlgo sha3_384HashAlgo; |
Sergunb | 0:8918a71cdbe9 | 53 | |
Sergunb | 0:8918a71cdbe9 | 54 | //SHA3-384 related functions |
Sergunb | 0:8918a71cdbe9 | 55 | error_t sha3_384Compute(const void *data, size_t length, uint8_t *digest); |
Sergunb | 0:8918a71cdbe9 | 56 | void sha3_384Init(Sha3_384Context *context); |
Sergunb | 0:8918a71cdbe9 | 57 | void sha3_384Update(Sha3_384Context *context, const void *data, size_t length); |
Sergunb | 0:8918a71cdbe9 | 58 | void sha3_384Final(Sha3_384Context *context, uint8_t *digest); |
Sergunb | 0:8918a71cdbe9 | 59 | |
Sergunb | 0:8918a71cdbe9 | 60 | #endif |
Sergunb | 0:8918a71cdbe9 | 61 |