/*
 * Cryptographic API.
 *
 * HMAC: Keyed-Hashing for Message Authentication (RFC2104).
 * SHA-256 is used as an underlying hash function.
 *
 * Author : Igor Shcheglakov (i.shcheglako@samsung.com)
 * Date   : 15 Dec 2017
 *
 * Copyright (C) 2017 Samsung Electronics Co., Ltd.
 *
 */

#ifndef _FMP_HMAC_SHA256_H
#define _FMP_HMAC_SHA256_H

#include "sha256.h"

struct hmac_sha256_ctx {
	struct fmp_shash_desc inner_ctx;
	struct fmp_shash_desc outer_ctx;
};

typedef struct hmac_sha256_ctx HMAC_SHA256_CTX;

/* Initialize hashing context using a key of key_len bytes.
 *
 * Return zero on success and negative otherwise
 */
int hmac_sha256_init(struct hmac_sha256_ctx *ctx, const u8 *key, unsigned int key_len);

/*  Hash data_len bytes of data
 *
 * Return zero on success and negative otherwise
 */
int hmac_sha256_update(struct hmac_sha256_ctx *ctx, const u8 *data, unsigned int data_len);

/* Add final padding to a hash and write resulting HMAC to out.
 * There must be at least SHA256_DIGEST_LENGTH bytes of space in out
 *
 * Return zero on success and negative otherwise
 */
int hmac_sha256_final(struct hmac_sha256_ctx *ctx, u8 *out);

/* Hash data_len bytes of data using key of key_len bytes.
 * Write resulting HMAC to out. There must be at least SHA256_DIGEST_LENGTH
 * bytes of space in out
 *
 * Return zero on success and negative otherwise
 */
int hmac_sha256(const u8 *key, unsigned int key_len, const u8 *data, unsigned int data_len, u8 *out);

/* Cleanup allocated resources */
void hmac_sha256_ctx_cleanup(struct hmac_sha256_ctx *ctx);

#endif /* _FMP_HMAC_SHA256_H */

