70ee483d320a270993b56c713e350b736edd753fAki Tuomi * FIPS 180-2 SHA-224/256/384/512 implementation
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * Last update: 02/02/2007
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * Issue date: 04/30/2005
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch>
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * All rights reserved.
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * Redistribution and use in source and binary forms, with or without
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * modification, are permitted provided that the following conditions
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * 1. Redistributions of source code must retain the above copyright
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * notice, this list of conditions and the following disclaimer.
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * 2. Redistributions in binary form must reproduce the above copyright
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * notice, this list of conditions and the following disclaimer in the
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * documentation and/or other materials provided with the distribution.
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * 3. Neither the name of the project nor the names of its contributors
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * may be used to endorse or promote products derived from this software
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * without specific prior written permission.
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * SUCH DAMAGE.
70ee483d320a270993b56c713e350b736edd753fAki Tuomi uint64_t saved; /* the portion of the input message that we
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * didn't consume yet */
70ee483d320a270993b56c713e350b736edd753fAki Tuomi union { /* Keccak's state */
70ee483d320a270993b56c713e350b736edd753fAki Tuomi unsigned byteIndex; /* 0..7--the next byte after the set one
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * (starts from 0; 0--none are buffered) */
70ee483d320a270993b56c713e350b736edd753fAki Tuomi unsigned wordIndex; /* 0..24--the next word to integrate input
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * (starts from 0) */
70ee483d320a270993b56c713e350b736edd753fAki Tuomi unsigned capacityWords; /* the double size of the hash output in
70ee483d320a270993b56c713e350b736edd753fAki Tuomi * words (e.g. 16 for Keccak 512) */
70ee483d320a270993b56c713e350b736edd753fAki Tuomi unsigned char digest[STATIC_ARRAY SHA256_RESULTLEN]);
70ee483d320a270993b56c713e350b736edd753fAki Tuomivoid sha3_256_get_digest(const void *data, size_t size,
70ee483d320a270993b56c713e350b736edd753fAki Tuomi unsigned char digest[STATIC_ARRAY SHA256_RESULTLEN]);
70ee483d320a270993b56c713e350b736edd753fAki Tuomi unsigned char digest[STATIC_ARRAY SHA512_RESULTLEN]);
70ee483d320a270993b56c713e350b736edd753fAki Tuomivoid sha3_512_get_digest(const void *data, size_t size,
70ee483d320a270993b56c713e350b736edd753fAki Tuomi unsigned char digest[STATIC_ARRAY SHA512_RESULTLEN]);
70ee483d320a270993b56c713e350b736edd753fAki Tuomivoid sha3_loop(void *context, const void *data, size_t len);
70ee483d320a270993b56c713e350b736edd753fAki Tuomiextern const struct hash_method hash_method_sha3_256;
70ee483d320a270993b56c713e350b736edd753fAki Tuomiextern const struct hash_method hash_method_sha3_512;