text: /*
  Copyright (c) 2018-2019, tevador <tevador@gmail.com>
  Copyright (c) 2019-2020, The Scala Project <hello@scalaproject.io>
  
  All rights reserved.
  
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:
  	* Redistributions of source code must retain the above copyright
  	  notice, this list of conditions and the following disclaimer.
  	* Redistributions in binary form must reproduce the above copyright
  	  notice, this list of conditions and the following disclaimer in the
  	  documentation and/or other materials provided with the distribution.
  	* Neither the name of the copyright holder nor the
  	  names of its contributors may be used to endorse or promote products
  	  derived from this software without specific prior written permission.
  
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
  
  /* Original code from Argon2 reference source code package used under CC0 Licence
   * https://github.com/P-H-C/phc-winner-argon2
   * Copyright 2015
   * Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
  */
  
  #include <stdint.h>
  #include <string.h>
  #include <stdio.h>
  
  #include "yespower/yespower.h"
  #include "k12/KangarooTwelve.h"
  #include "blake3/blake3.h"
  
  /* Yespower */
  int yespower_hash(const void *data, size_t length, void *hash)
  {
  		yespower_params_t params = {
  		.version = YESPOWER_1_0,
  		.N = 2048,
  		.r = 8,
  		.pers = NULL
  		};
  
  		int finale_yespower = yespower_tls((const uint8_t *)data, length, &params, (yespower_binary_t *)hash);
  		return finale_yespower; //0 for success
  }
  
  /* KangarooTwelve */
  int k12(const void *data, size_t length, void *hash)
  {
    int kDo = KangarooTwelve((const unsigned char *)data, length, (unsigned char *)hash, 32, 0, 0);
    return kDo;
  }
  
  /* Blake3 */
  int blake3(const void *data, size_t length, void *hash)
  {
  	blake3_hasher hasher;
  	blake3_hasher_init(&hasher);
  	blake3_hasher_update(&hasher, data, length);
  	blake3_hasher_finalize(&hasher, hash, length);
  }
  
  int yespower_hash_b(const void *data, size_t length, void *hash)
  {
  		int blakeRes = blake3(data, length, hash);
  
  		yespower_params_t params = {
  			.version = YESPOWER_1_0,
  			.N = 65536,
  			.r = 18,
  			.pers = NULL
  		};
  
  		int finale_yespower = yespower_tls((const uint8_t *)data, length, &params, (yespower_binary_t *)hash);
  		return finale_yespower;
  }