/*
 * nxp_sha.h
 *
 * (C) Copyright 2007-2009 Andre McCurdy, NXP Semiconductors
 *
 * This program 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 2 of
 * the License, or (at your option) any later version.
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

/*
   Temp hack (code requiring SHA1 should ideally be using crypto API).
*/

#ifndef _NXP_SHA_H_
#define _NXP_SHA_H_

#ifdef __KERNEL__

#define SHA_DIGEST_LENGTH	20

/*
   Warning: struct layout below is hardcoded within assembler routines...
*/
typedef struct
{
	unsigned int state[5];
	unsigned int bytesHandled;	/* Not quite offical SHA1: will behave differently if hashing >= 2^32 bytes */
	unsigned char buffer[64];
}
NXP_SHA_CTX;

extern void nxp_SHA1_Init (NXP_SHA_CTX *context);
extern void nxp_SHA1_Update (NXP_SHA_CTX *context, unsigned char *input, unsigned long input_bytes);
extern void nxp_SHA1_Final (unsigned char digest[SHA_DIGEST_LENGTH], NXP_SHA_CTX *context);

#endif
#endif

