/**1* Header file for the Lyra2 Password Hashing Scheme (PHS).2*3* Author: The Lyra PHC team (http://www.lyra-kdf.net/) -- 2014.4*5* This software is hereby placed in the public domain.6*7* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS8* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED9* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE10* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE11* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR12* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF13* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR14* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,15* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE16* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,17* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.18*/19#ifndef LYRA2_H_20#define LYRA2_H_2122#include <stdint.h>2324typedef unsigned char byte;2526//Block length required so Blake2's Initialization Vector (IV) is not overwritten (THIS SHOULD NOT BE MODIFIED)27#define BLOCK_LEN_BLAKE2_SAFE_INT64 8 //512 bits (=64 bytes, =8 uint64_t)28#define BLOCK_LEN_BLAKE2_SAFE_BYTES (BLOCK_LEN_BLAKE2_SAFE_INT64 * 8) //same as above, in bytes293031#ifdef BLOCK_LEN_BITS32#define BLOCK_LEN_INT64 (BLOCK_LEN_BITS/64) //Block length: 768 bits (=96 bytes, =12 uint64_t)33#define BLOCK_LEN_BYTES (BLOCK_LEN_BITS/8) //Block length, in bytes34#else //default block lenght: 768 bits35#define BLOCK_LEN_INT64 12 //Block length: 768 bits (=96 bytes, =12 uint64_t)36#define BLOCK_LEN_BYTES (BLOCK_LEN_INT64 * 8) //Block length, in bytes37#endif3839int LYRA2(void *K, int64_t kLen, const void *pwd, int32_t pwdlen, const void *salt, int32_t saltlen, int64_t timeCost, const int16_t nRows, const int16_t nCols);4041int LYRA2_3(void *K, int64_t kLen, const void *pwd, int32_t pwdlen, const void *salt, int32_t saltlen, int64_t timeCost, const int16_t nRows, const int16_t nCols);4243#endif /* LYRA2_H_ */444546