|
SASC-NG
DVBSoftCAM
|
Inheritance diagram for cIrdeto:Protected Member Functions | |
| void | SessionKeyCrypt (unsigned char *data, const unsigned char *key, int date) |
| bool | SignatureCheck (const unsigned char *data, int length, const unsigned char *key, int date, const unsigned char *signature, int keylen) |
| void | DecryptIrd (unsigned char *data, unsigned char *key, int rounds, int offset) |
| void cIrdeto::DecryptIrd | ( | unsigned char * | data, |
| unsigned char * | key, | ||
| int | rounds, | ||
| int | offset | ||
| ) | [protected] |
Definition at line 172 of file irdeto1.c.
Referenced by cSystemIrd::ProcessEMM(), SessionKeyCrypt(), and SignatureCheck().
| void cIrdeto::SessionKeyCrypt | ( | unsigned char * | data, |
| const unsigned char * | key, | ||
| int | date | ||
| ) | [protected] |
Definition at line 184 of file irdeto1.c.
References DecryptIrd().
Referenced by cSystemIrd::ProcessECM(), and cSystemIrd::ProcessEMM().
{
MakeTempKey(key,date);
DecryptIrd(data,tempKey,128,16);
}
| bool cIrdeto::SignatureCheck | ( | const unsigned char * | data, |
| int | length, | ||
| const unsigned char * | key, | ||
| int | date, | ||
| const unsigned char * | signature, | ||
| int | keylen | ||
| ) | [protected] |
Definition at line 190 of file irdeto1.c.
References DecryptIrd(), i, and j.
Referenced by cSystemIrd::ProcessECM(), and cSystemIrd::ProcessEMM().
{
unsigned char buffer[256];
memcpy(buffer,data,length);
int rounds;
if((length%8)==0) rounds=40;
else {
int i=0x61;
while((length%8)!=0) buffer[length++]=i++;
rounds=104;
}
if(keylen==10) memcpy(tempKey,key,10);
else MakeTempKey(key,date);
int i=0;
while(i<length-8) {
DecryptIrd(buffer,tempKey,40,0);
i+=8;
for(int j=0; j<8; j++) buffer[j] ^= buffer[i+j];
Rotate(tempKey);
}
DecryptIrd(buffer,tempKey,rounds,0);
return memcmp(buffer,signature,5)==0;
}