change some parameters in the library to meet the needs of the website httpbin.org
Fork of MiniTLS-GPL by
crypto/crypto_sha256.h@5:95f70ebfe61f, 2015-02-06 (annotated)
- Committer:
- shiyilei
- Date:
- Fri Feb 06 06:17:33 2015 +0000
- Revision:
- 5:95f70ebfe61f
- Parent:
- 2:527a66d0a1a9
change some parameters in the library to meet the needs of httpbin.org
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MiniTLS | 2:527a66d0a1a9 | 1 | /* |
MiniTLS | 2:527a66d0a1a9 | 2 | MiniTLS - A super trimmed down TLS/SSL Library for embedded devices |
MiniTLS | 2:527a66d0a1a9 | 3 | Author: Donatien Garnier |
MiniTLS | 2:527a66d0a1a9 | 4 | Copyright (C) 2013-2014 AppNearMe Ltd |
MiniTLS | 2:527a66d0a1a9 | 5 | |
MiniTLS | 2:527a66d0a1a9 | 6 | This program is free software; you can redistribute it and/or |
MiniTLS | 2:527a66d0a1a9 | 7 | modify it under the terms of the GNU General Public License |
MiniTLS | 2:527a66d0a1a9 | 8 | as published by the Free Software Foundation; either version 2 |
MiniTLS | 2:527a66d0a1a9 | 9 | of the License, or (at your option) any later version. |
MiniTLS | 2:527a66d0a1a9 | 10 | |
MiniTLS | 2:527a66d0a1a9 | 11 | This program is distributed in the hope that it will be useful, |
MiniTLS | 2:527a66d0a1a9 | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
MiniTLS | 2:527a66d0a1a9 | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MiniTLS | 2:527a66d0a1a9 | 14 | GNU General Public License for more details. |
MiniTLS | 2:527a66d0a1a9 | 15 | |
MiniTLS | 2:527a66d0a1a9 | 16 | You should have received a copy of the GNU General Public License |
MiniTLS | 2:527a66d0a1a9 | 17 | along with this program; if not, write to the Free Software |
MiniTLS | 2:527a66d0a1a9 | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
MiniTLS | 2:527a66d0a1a9 | 19 | *//** |
MiniTLS | 2:527a66d0a1a9 | 20 | * \file crypto_sha256.h |
MiniTLS | 2:527a66d0a1a9 | 21 | * \copyright Copyright (c) AppNearMe Ltd 2013 |
MiniTLS | 2:527a66d0a1a9 | 22 | * \author Donatien Garnier |
MiniTLS | 2:527a66d0a1a9 | 23 | */ |
MiniTLS | 2:527a66d0a1a9 | 24 | |
MiniTLS | 2:527a66d0a1a9 | 25 | #ifndef CRYPTO_SHA256_H_ |
MiniTLS | 2:527a66d0a1a9 | 26 | #define CRYPTO_SHA256_H_ |
MiniTLS | 2:527a66d0a1a9 | 27 | |
MiniTLS | 2:527a66d0a1a9 | 28 | #ifdef __cplusplus |
MiniTLS | 2:527a66d0a1a9 | 29 | extern "C" { |
MiniTLS | 2:527a66d0a1a9 | 30 | #endif |
MiniTLS | 2:527a66d0a1a9 | 31 | |
MiniTLS | 2:527a66d0a1a9 | 32 | #include "core/fwk.h" |
MiniTLS | 2:527a66d0a1a9 | 33 | |
MiniTLS | 2:527a66d0a1a9 | 34 | #define SHA256_SIZE 32 //256 bits |
MiniTLS | 2:527a66d0a1a9 | 35 | #define SHA256_BLOCK_SIZE 64 |
MiniTLS | 2:527a66d0a1a9 | 36 | |
MiniTLS | 2:527a66d0a1a9 | 37 | typedef struct __crypto_sha256 |
MiniTLS | 2:527a66d0a1a9 | 38 | { |
MiniTLS | 2:527a66d0a1a9 | 39 | uint64_t length; |
MiniTLS | 2:527a66d0a1a9 | 40 | uint32_t state[8], curlen; |
MiniTLS | 2:527a66d0a1a9 | 41 | uint8_t buf[64]; |
MiniTLS | 2:527a66d0a1a9 | 42 | } crypto_sha256_t; |
MiniTLS | 2:527a66d0a1a9 | 43 | |
MiniTLS | 2:527a66d0a1a9 | 44 | void crypto_sha256_init(crypto_sha256_t* hash); |
MiniTLS | 2:527a66d0a1a9 | 45 | void crypto_sha256_update(crypto_sha256_t* hash, const uint8_t* data, size_t size); |
MiniTLS | 2:527a66d0a1a9 | 46 | void crypto_sha256_end(crypto_sha256_t* hash, uint8_t* out); |
MiniTLS | 2:527a66d0a1a9 | 47 | |
MiniTLS | 2:527a66d0a1a9 | 48 | void crypto_sha256_copy(crypto_sha256_t* hashTo, crypto_sha256_t* hashFrom); |
MiniTLS | 2:527a66d0a1a9 | 49 | |
MiniTLS | 2:527a66d0a1a9 | 50 | |
MiniTLS | 2:527a66d0a1a9 | 51 | #ifdef __cplusplus |
MiniTLS | 2:527a66d0a1a9 | 52 | } |
MiniTLS | 2:527a66d0a1a9 | 53 | #endif |
MiniTLS | 2:527a66d0a1a9 | 54 | |
MiniTLS | 2:527a66d0a1a9 | 55 | #endif /* CRYPTO_SHA256_H_ */ |