SASC
DVBSoftCAM

cCamCryptVG2 Class Reference

Inheritance diagram for cCamCryptVG2:

List of all members.

Public Member Functions

void PostProcess_Decrypt (unsigned char *buff, int len, unsigned char *cw1, unsigned char *cw2)
void SetSeed (const unsigned char *Key1, const unsigned char *Key2)
void GetCamKey (unsigned char *buff)
void PostProcess_Decrypt (unsigned char *buff, int len, unsigned char *cw1, unsigned char *cw2)
void SetSeed (const unsigned char *Key1, const unsigned char *Key2)
void GetCamKey (unsigned char *buff)

Detailed Description

Definition at line 165 of file sc-videoguard2.c.


Member Function Documentation

void cCamCryptVG2::GetCamKey ( unsigned char *  buff)

Definition at line 191 of file sc-videoguard2.c.

References i.

Referenced by cSmartCardVideoGuard2::Init().

{
  unsigned short *tb2=(unsigned short *)buff, c=1;
  memset(tb2,0,64);
  tb2[0]=1;
  for(int i=0; i<32; i++) LongMult(tb2,&c,cardkeys[1][i],0);
}
void cCamCryptVG2::GetCamKey ( unsigned char *  buff)
void cCamCryptVG2::PostProcess_Decrypt ( unsigned char *  buff,
int  len,
unsigned char *  cw1,
unsigned char *  cw2 
)
void cCamCryptVG2::PostProcess_Decrypt ( unsigned char *  buff,
int  len,
unsigned char *  cw1,
unsigned char *  cw2 
)

Definition at line 199 of file sc-videoguard2.c.

Referenced by cSmartCardVideoGuard2::DoCmd().

{
  switch(buff[0]) {
    case 0xD0:
      Process_D0(buff,buff+5,buff+buff[4]+5);
      break;
    case 0xD1:
      Process_D1(buff,buff+5,buff+buff[4]+5);
      break;
    case 0xD3:
      Decrypt_D3(buff,buff+5,buff+buff[4]+5);
      if(buff[1]==0x54) {
        memcpy(cw1,buff+5,8);
        for(int ind=14; ind<len+5;) {
          if(buff[ind]==0x25) {
            memcpy(cw2,buff+5+ind+2,8);
            break;
            }
          if(buff[ind+1]==0) break;
          ind+=buff[ind+1];
          }
        }
      break;
    }
}
void cCamCryptVG2::SetSeed ( const unsigned char *  Key1,
const unsigned char *  Key2 
)

Definition at line 185 of file sc-videoguard2.c.

Referenced by cSmartCardVideoGuard2::Init().

{
  memcpy(cardkeys[1],Key1,sizeof(cardkeys[1]));
  memcpy(cardkeys[2],Key2,sizeof(cardkeys[2]));
}
void cCamCryptVG2::SetSeed ( const unsigned char *  Key1,
const unsigned char *  Key2 
)

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines