#ident "$Id: decrypt_common.h,v 1.4 2008/08/08 18:32:47 cnguyen Exp $"
/*
 *               Copyright (C) 2005, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished  proprietary information of BroadOn Communications Corp.,
 *  and  are protected by Federal copyright law. They may not be disclosed
 *  to  third  parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */

#ifndef _DECRYPT_COMMON_H_
#define _DECRYPT_COMMON_H_

/*
 * This file contains declarations for routines common to programs
 * that decrypt partitions and their data
 */

#include "types.h"
#include "sha1.h"
#include "estypes.h"            // From NC/GBA tree
#include "es_int.h"             // From NC/GBA tree
#include "iosccert.h"           // From NC/GBA tree



/* Should be big enough to contain a reasonable shell command */
#define COMMAND_BUF_LEN         1024

/*
 * These numbers vary from file system to file system, and operating
 * system to operating system.  So just pick some reasonable values.
 */
#define FILE_NAME_MAX            256
#define PATH_LEN_MAX            1024

bool verifyHashArray(u8* dataArray, const u32 dataArrayLength,
                     const u8* const hashValuePtr);
int computeHash(u8 *data, u32 length, u8 *hash);

bool getAesKeyFromTextFile(const char* const fileName, u8 **decryptKey);

#endif
