rockbox/utils/nwztools/upgtools/fwp.h
Amaury Pouly 214f226ca6 upgtools: allow creation of a UPG archive + improvements
Change-Id: I9c3e2eb95f7eb6d41591b006328fd720dfcf93a5
2012-11-13 18:25:00 +01:00

45 lines
1.4 KiB
C

/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2012 Amaury Pouly
*
* 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef __fwp_h__
#define __fwp_h__
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define NWZ_KAS_SIZE 32
#define NWZ_KEYSIG_SIZE 51
#define NWZ_KEY_SIZE 8
#define NWZ_EXPKEY_SIZE (NWZ_KEY_SIZE * NWZ_KEY_SIZE)
#define NWZ_DES_BLOCK 8
int fwp_read(void *in, int size, void *out, uint8_t *key);
int fwp_write(void *in, int size, void *out, uint8_t *key);
void fwp_setkey(char key[8]);
int fwp_crypt(void *buf, int size, int mode);
#ifdef __cplusplus
}
#endif
#endif /* __fwp_h__ */