SASC-NG
DVBSoftCAM

cSeca2ProvNL Class Reference

Inheritance diagram for cSeca2ProvNL:

List of all members.

Public Member Functions

 cSeca2ProvNL (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 bool DoSigCheck (void)

Detailed Description

Definition at line 897 of file seca.c.


Constructor & Destructor Documentation

cSeca2ProvNL::cSeca2ProvNL ( unsigned short  Id)

Definition at line 921 of file seca.c.

References cSeca2Prov::pData, and provDataNL.


Member Function Documentation

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

Implements cSeca2Prov.

Definition at line 1018 of file seca.c.

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

{
  static const unsigned short tabIdx[] = { 0x000, 0x4C3, 0x5D8, 0x63A, 0x471, 0x639, 0x417, 0x6CD };
  static const unsigned char  tabXor[] = {  0x84,  0xD6,  0x3A,  0x1F,  0x25,  0xB1,  0x7D,  0xF7 };
  static const unsigned char tabPos1[] = {     2,     4,     3,     4,     5,     7,     6,     7 };
  static const unsigned char tabPos2[] = {     3,     1,     5,     6,     0,     1,     0,     2 };

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

  idx1=(index^0x2B36) & 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[tabPos1[i]]^=xorVal;
    data[tabPos2[i]]^=T2[idx2];
    }
}
virtual bool cSeca2ProvNL::DoSigCheck ( void  ) [inline, protected, virtual]

Reimplemented from cSeca2Prov.

Definition at line 908 of file seca.c.

{ return false; }
bool cSeca2ProvNL::InitSSE ( void  ) [protected, virtual]

Implements cSeca2ProvSSE.

Definition at line 927 of file seca.c.

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

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

Reimplemented from cSeca2Prov.

Definition at line 997 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=CWT1(), *T4=SSEPT2();
  unsigned char key[8];
  unsigned int off2;

  off2=data[2]^data[8+6];
  key[2]=T4[off2]; key[5]=T4[(off2+key[2])&0xff];

  off2=(data[3]<<8)|data[8+4]; key[0]=T3[off2&0x1ff];
  off2+=key[2]; key[4]=T3[off2&0x1ff];

  off2=(data[0]<<8)|data[8+7]; key[7]=T2[off2&0x7ff];
  off2+=key[0]; key[1]=T2[off2&0x7ff];

  off2=(data[1]<<8)|data[8+5]; key[3]=T1[off2&0xbff];
  off2+=key[4]; key[6]=T1[off2&0xbff];

  des.Des(data+4,key,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