// hash.c// 2019-02-20 Markku-Juhani O. Saarinen <mjos@pqshield.com>// Copyright (C) 2019, PQShield Ltd. Please see LICENSE.// Reference SNEIKHA hash using the BLNK calls#include "api.h"#include "crypto_hash.h"#include "blnk.h"// Single-call NIST interfaceintcrypto_hash(unsignedchar*out,constunsignedchar*in,unsignedlonglonginlen){blnk_tctx;// Local state// Clear state, set parametersblnk_clr(&ctx,SNEIKHA_RATE,SNEIKHA_ROUNDS);// Process inputblnk_put(&ctx,BLNK_AD,in,(size_t)inlen);blnk_fin(&ctx,BLNK_AD);// Get the hashblnk_get(&ctx,BLNK_HASH,out,CRYPTO_BYTES);// blnk_fin(&ctx, BLNK_HASH); // For intermediate hashesreturn0;// Success}