/*
 *               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 __IOSNVM_H__
#define __IOSNVM_H__

#include <types.h>
#include <csltypes.h>

/*
 * NVM data structure definition. Data is loaded from non-volatile 
 * source like kilopass, eeprom or a data file on flash. 
 * The alignment or ordering of data in this structure does not
 * reflect actual offsets in the NVM storage.
 */

typedef struct {

    /* write once data */

    CSLOSSha1Hash bootHash;       /* sha1 hash of next level boot in flash */
    u32 deviceId;		  /* player's identity: unique serial number */
    CSLOSAesKey commonKey;        /* common key for decrypting licenses */
    CSLOSEccPrivateKey signingKey;/* player's private key: from ECC key pair */
    CSLOSAesKey fsAesKey;	  /* key for file system encryption */
    CSLOSHMACKey fsHmacKey;        /* key for file system Hmac */
    CSLOSAesKey transferAesKey;	  /* key for transfer encryption */
    CSLOSHMACKey transferHmacKey;  /* key for transfer HMAC */
    u32 signerId;                 /* numeric suffix : ID of signing server */
    u32 signerCAId;                 /* numeric suffix: ID of signing CA */
    CSLOSEccSig certSign;     /* Signature of server on device cert */
    u32 wp_lplock;                /* copy of security flags: pad on left  */
    
    /* re-writeable data */

    u8 bootOSVersion;  /* to enforce latest version for boot OS */
    u8 caCrlVersion;    /* CA CRL version */
    u8 signerCrlVersion;/* signer CRL version */
    u16 fsFileVersion;   /* this number is the version number that 
                          *  protects versioned files in FS. Could be 
                          *  only used for consumption data file and 
                          *  OS Version file 
                         */
} IOSNvm;
    
#endif /*__IOSNVM_H__*/
