|
SASC-NG
DVBSoftCAM
|
Inheritance diagram for cIrdeto2:Protected Member Functions | |
| void | Encrypt (unsigned char *data, const unsigned char *seed, const unsigned char *key, int len) |
| void | Decrypt (unsigned char *data, const unsigned char *seed, const unsigned char *key, int len) |
| bool | CalculateHash (const unsigned char *key, const unsigned char *iv, const unsigned char *data, int len) |
| bool cIrdeto2::CalculateHash | ( | const unsigned char * | key, |
| const unsigned char * | iv, | ||
| const unsigned char * | data, | ||
| int | len | ||
| ) | [protected] |
Definition at line 90 of file irdeto2.c.
References L_SYS_VERBOSE, LDUMP, and xxor.
Referenced by cSystemIrd2::ProcessECM(), and cSystemIrd2::ProcessEMM().
{
ScheduleKey(key);
unsigned char cbuff[8];
memset(cbuff,0,sizeof(cbuff));
len-=8;
for(int y=0; y<len; y+=8) {
if(y<len-8) {
xxor(cbuff,8,cbuff,&data[y]);
LDUMP(L_SYS_VERBOSE,cbuff,8,"3DES XOR in:");
}
else {
int l=len-y;
xxor(cbuff,l,cbuff,&data[y]);
xxor(cbuff+l,8-l,cbuff+l,iv+8);
LDUMP(L_SYS_VERBOSE,cbuff,8,"3DES XOR(%d) in:",8-l);
}
DES3(cbuff,0);
LDUMP(L_SYS_VERBOSE,cbuff,8,"3DES out:");
}
LDUMP(L_SYS_VERBOSE,cbuff,8,"CryptBuffer:");
LDUMP(L_SYS_VERBOSE,&data[len],8,"MACBuffer:");
return memcmp(cbuff,&data[len],8)==0;
}
| void cIrdeto2::Decrypt | ( | unsigned char * | data, |
| const unsigned char * | seed, | ||
| const unsigned char * | key, | ||
| int | len | ||
| ) | [protected] |
Definition at line 76 of file irdeto2.c.
Referenced by cSystemIrd2::ProcessECM(), and cSystemIrd2::ProcessEMM().
| void cIrdeto2::Encrypt | ( | unsigned char * | data, |
| const unsigned char * | seed, | ||
| const unsigned char * | key, | ||
| int | len | ||
| ) | [protected] |