CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Common/Crypto/sha256.h
Views: 1401
1
/*
2
* FIPS-180-2 compliant SHA-256 implementation
3
*
4
* Copyright (C) 2001-2003 Christophe Devine
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
*/
20
21
22
// Lightly modified by hrydgard (inttypes.h, const input)
23
24
#ifndef _SHA256_H
25
#define _SHA256_H
26
27
#include <inttypes.h>
28
29
struct sha256_context {
30
uint32_t total[2];
31
uint32_t state[8];
32
uint8_t buffer[64];
33
};
34
35
void sha256_starts(sha256_context *ctx);
36
void sha256_update(sha256_context *ctx, const uint8_t *input, uint32_t length);
37
void sha256_finish(sha256_context *ctx, uint8_t digest[32]);
38
39
#endif /* sha256.h */
40
41