SASC-NG
DVBSoftCAM

cSeca2ProvFR Class Reference

Inheritance diagram for cSeca2ProvFR:

List of all members.

Public Member Functions

 cSeca2ProvFR (unsigned short Id)

Protected Member Functions

virtual bool InitSSE (void)
virtual void PostCW (unsigned char *data)
virtual void ChainTableXor (unsigned char *data, unsigned short index)
virtual void SignatureMod (unsigned char *MD, const unsigned char *PK)

Detailed Description

Definition at line 736 of file seca.c.


Constructor & Destructor Documentation

cSeca2ProvFR::cSeca2ProvFR ( unsigned short  Id)

Definition at line 760 of file seca.c.

References cSeca2Prov::pData, and provDataFR.


Member Function Documentation

void cSeca2ProvFR::ChainTableXor ( unsigned char *  data,
unsigned short  index 
) [protected, virtual]

Implements cSeca2Prov.

Definition at line 862 of file seca.c.

References i, cSeca2Prov::MT(), and cSeca2ProvSSE::SSET1().

{
  static const unsigned char tabIdx[] = { 0x00, 0x08, 0x03, 0x1F, 0x06, 0x32, 0x12, 0x0C };
  static const unsigned char tabXor[] = { 0x77, 0x2B, 0xC8, 0xEE, 0x2F, 0xD3, 0x22, 0x29 };
  static const unsigned char tabPos[] = {    0,    2,    1,    6,    4,    5,    7,    3 };

  unsigned int idx1, idx2;
  unsigned char xorVal=0;
  const unsigned char *T1=MT(), *T2=SSET1();

  idx1 = (index^0x17AC) & 0x3FFF;
  idx2 = idx1 & 0xBFF;
  for(int i=0; i<8; i++) {
    idx1 = (idx1 + tabIdx[i]) & 0x3FFF;
    idx2 = (idx2 + xorVal) & 0xBFF;
    xorVal ^= T1[idx1] ^ tabXor[i];
    data[tabPos[i]] ^= xorVal ^ T2[idx2];
    }
}
bool cSeca2ProvFR::InitSSE ( void  ) [protected, virtual]

Implements cSeca2ProvSSE.

Definition at line 766 of file seca.c.

References cSeca2ProvSSE::cw, cSeca2Prov::GetMap(), cSeca2ProvSSE::sse, and cSeca2ProvSSE::sseP.

{
  sse=GetMap("sse",5120,true);
  sseP=GetMap("sse",1104,false);
  cw=GetMap("cw",512,false);
  return sse && sseP && cw;
}
void cSeca2ProvFR::PostCW ( unsigned char *  data) [protected, virtual]

Reimplemented from cSeca2Prov.

Definition at line 846 of file seca.c.

References cSeca2ProvSSE::CWT1(), cDes::Des(), cSeca2ProvSSE::des, SECA_DES_ENCR, cSeca2ProvSSE::SSEPT2(), cSeca2ProvSSE::SSET1(), and cSeca2ProvSSE::SSET2().

{
  const unsigned char *T1=SSET1(), *T2=SSET2(), *T3=SSEPT2(), *T4=CWT1();
  unsigned int idx;
  unsigned char key[8];
  idx=((data[0]<<8)|data[1]);     key[0]=T3[idx & 0x3FF];
  idx=(idx + key[0]);             key[1]=T3[idx & 0x3FF];
  idx=((data[2]<<8)|data[3]);     key[2]=T4[idx & 0x1FF];
  idx=idx + key[2];               key[3]=T4[idx & 0x1FF];
  idx=((data[8+4]<<8)|data[8+5]); key[4]=T2[idx & 0x7FF];
  idx=idx + key[4];               key[5]=T2[idx & 0x7FF];
  idx=((data[8+6]<<8)|data[8+7]); key[6]=T1[idx & 0xBFF];
  idx=idx + key[6];               key[7]=T1[idx & 0xBFF];
  des.Des(data+4,key,SECA_DES_ENCR);
}
void cSeca2ProvFR::SignatureMod ( unsigned char *  MD,
const unsigned char *  PK 
) [protected, virtual]

Reimplemented from cSeca2Prov.

Definition at line 882 of file seca.c.

References cDes::Des(), cSeca2ProvSSE::des, SECA_DES_ENCR, and cSeca2ProvSSE::SSEPT2().

{
  const unsigned char *T1=SSEPT2();
  unsigned int idx;

  idx = ((MD[18] << 8) | MD[19]) & 0x3FF;
  MD[10]  = T1[idx];
  MD[13] ^= PK[6];
  idx = ((MD[15] << 8) | MD[13]) & 0x3FF;
  MD[16]  = T1[idx];
  des.Des(MD,MD+10,SECA_DES_ENCR);
}

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