sha256_i.h
Go to the documentation of this file.
/*
* SHA-256 internal definitions
* Copyright (c) 2003-2011, Jouni Malinen <j@w1.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
* See README and COPYING for more details.
*/
#ifndef SHA256_I_H
#define SHA256_I_H
#define SHA256_BLOCK_SIZE 64
struct sha256_state {
u64 length;
u32 state[8], curlen;
u8 buf[SHA256_BLOCK_SIZE];
};
void sha256_init(struct sha256_state *md);
int sha256_process(struct sha256_state *md, const unsigned char *in,
unsigned long inlen);
int sha256_done(struct sha256_state *md, unsigned char *out);
#endif /* SHA256_I_H */
u64
uint64_t u64
Definition: common.h:24
u8
uint8_t u8
Definition: common.h:27
u32
uint32_t u32
Definition: common.h:25
sha256_done
int sha256_done(struct sha256_state *md, unsigned char *out)
Terminate the hash to get the digest.
Definition: sha256-internal.c:190
SHA256_BLOCK_SIZE
#define SHA256_BLOCK_SIZE
Definition: sha256_i.h:18
sha256_init
void sha256_init(struct sha256_state *md)
Definition: sha256-internal.c:129
sha256_process
int sha256_process(struct sha256_state *md, const unsigned char *in, unsigned long inlen)
Process a block of memory though the hash.
Definition: sha256-internal.c:150
sha256_state
Definition: sha256_i.h:20
sha256_state::curlen
u32 curlen
Definition: sha256_i.h:22
sha256_state::state
u32 state[8]
Definition: sha256_i.h:22
sha256_state::buf
u8 buf[SHA256_BLOCK_SIZE]
Definition: sha256_i.h:23
sha256_state::length
u64 length
Definition: sha256_i.h:21