/*****************************************************************************
 *
 * Copyright (c) 2018-19, Eduard Gerlits, Paula Herber, Josef Treus
 * Westfälische Wilhelms-Universität Münster, AG Embedded Systems 
 * All rights reserved.
 *
 * This file is part of SysCSec
 *
 * SysCSec is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * SysCSec is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with SysCSec.  If not, see <http://www.gnu.org/licenses/>.
 *
 *
 *  Please report any problems or bugs to: sysc.sec@uni-muenster.de
 *
 ****************************************************************************/

#ifndef _SHA1MODULE_H_
#define _SHA1MODULE_H_

#include <systemc.h>
#include <string>
#include "sha1.h"

/*
This module executes a SHA1 hash function on the input string
*/

SC_MODULE(SHA1Module){

	// input string
	sc_fifo_in<std::string> in;

	// hash output at sc_biguint<160>
	sc_fifo_out<sc_biguint<160> > out;

	void exe();
	void int_convert(std::string hash, sc_biguint<160> &num_hash);

	SC_CTOR(SHA1Module){
		SC_THREAD(exe);
	}

};

#endif
