Subversion Repositories freemyipod

Rev

Rev 273 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 273 Rev 275
Line 28... Line 28...
28
 
28
 
29
 
29
 
30
void hwkeyaes(enum hwkeyaes_direction direction, uint32_t keyidx, void* data, uint32_t size)
30
void hwkeyaes(enum hwkeyaes_direction direction, uint32_t keyidx, void* data, uint32_t size)
31
{
31
{
32
    int i;
32
    int i;
33
    clockgate_enable(7, true);
33
    clockgate_enable(10, true);
34
    for (i = 0; i < 4; i++) AESIV[i] = 0;
34
    for (i = 0; i < 4; i++) AESIV[i] = 0;
35
    AESUNKREG0 = 1;
35
    AESUNKREG0 = 1;
36
    AESUNKREG0 = 0;
36
    AESUNKREG0 = 0;
37
    AESCONTROL = 1;
37
    AESCONTROL = 1;
38
    AESUNKREG1 = 0;
38
    AESUNKREG1 = 0;
Line 49... Line 49...
49
    AESSIZE3 = size;
49
    AESSIZE3 = size;
50
	clean_dcache();
50
	clean_dcache();
51
    AESGO = 1;
51
    AESGO = 1;
52
	invalidate_dcache();
52
	invalidate_dcache();
53
    while (!(AESSTATUS & 0xf)) sleep(100);
53
    while (!(AESSTATUS & 0xf)) sleep(100);
54
    clockgate_enable(7, false);
54
    clockgate_enable(10, false);
55
}
55
}