mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
入れ忘れ
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@40 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
e9fa033272
commit
73bb413426
46
build/libraries/aes/ARM7/aes_util.c
Normal file
46
build/libraries/aes/ARM7/aes_util.c
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: TwlIPL - libraries - aes
|
||||||
|
File: aes_util.c
|
||||||
|
|
||||||
|
Copyright 2007 Nintendo. All rights reserved.
|
||||||
|
|
||||||
|
These coded instructions, statements, and computer programs contain
|
||||||
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
Company Ltd., 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 Nintendo.
|
||||||
|
|
||||||
|
$Date:: $
|
||||||
|
$Rev$
|
||||||
|
$Author$
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include <firm/aes.h>
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Name: AESi_AddCounter
|
||||||
|
|
||||||
|
Description: calculate updated counter
|
||||||
|
|
||||||
|
Arguments: pCounter pointer to the counter at offset 0
|
||||||
|
nums offset in blocks (AES_BLOCK_SIZE)
|
||||||
|
|
||||||
|
Returns: None
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
void AESi_AddCounter(AESCounter* pCounter, u32 nums)
|
||||||
|
{
|
||||||
|
u32 data = 0;
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
data += pCounter->bytes[i] + (nums & 0xFF);
|
||||||
|
pCounter->bytes[i] = (u8)(data & 0xFF);
|
||||||
|
data >>= 8;
|
||||||
|
nums >>= 8;
|
||||||
|
if ( !data && !nums )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user