/*-----------------------------------------------------------------------------------
!
!                              COPYRIGHT 2015 BY
!                            MegaChips Corporation
!
!------------------------------------------------------------------------------------
! These coded instructions, statements, and computer programs include
! intellectual property and know-how belonging to MegaChips
! Corporaiton ("MCC") and its partner companies.
! Therefore, do not use these specifications for any purpose other than
! the purpose
! expressly agreed to by MCCs customer and MCC.  Also, do not duplicate,
! copy,
! or reproduce these specifications, nor reveal these specifications to
! any third party
! without MCCs prior written consent.
!
*/
/*-----------------------------------------------------------------------------------
  FILE        : sha.h
  DESCRIPTION : sha.c header
  Revision    : $Revision: 4 $
  Author      : $Author: shirait $
  Date        : $Date: 2015-09-09 15:19:58 +0900 (豌ｴ, 09 9 2015) $
-----------------------------------------------------------------------------------*/
#ifndef ___SHA_H_INCLUDED___
#define ___SHA_H_INCLUDED___

/********************************************************************************************
include
********************************************************************************************/
#include <stdint.h>
#include "ctl.h"

/********************************************************************************************
define
********************************************************************************************/
#define SHA256_LEN    (32)
#define SEEDMASK_LEN  (32)
#define DBMASK_LEN    (223)


/********************************************************************************************
macro
********************************************************************************************/
//
//
// BootCodeサイズを抑えるため、一部マクロ化しています
//
//

/*---------------------------------------------------------------------------
  function  : SHAモジュールのリセット
  arguments : none
  return    : void
  detail    : none
--------------------------------------------------------------------------*/
#define SHA_Reset CTL_ResetSHA


/*************************************************************************************
prottype
*************************************************************************************/
void SHA_Init(void);
volatile const char* SHA256_FastCalc(volatile const void* pSrc, uint16_t srcSize);
#ifndef FW
#define SHAR_MIDLE_SIZE (1024)
volatile const char* SHA256_Calc(const void* pSrc, uint16_t size);
#endif


#endif // ___SHA_REG_H_INCLUDED___
