SASC
DVBSoftCAM

cIDEA Class Reference

#include <crypto.h>

List of all members.

Public Member Functions

void Decrypt (unsigned char *data, int len, const unsigned char *key, unsigned char *iv) const
void Decrypt (const unsigned char *data, int len, unsigned char *decrypt, const unsigned char *key, unsigned char *iv) const
int Encrypt (const unsigned char *data, int len, unsigned char *crypt, const unsigned char *key, unsigned char *iv) const
void SetEncKey (const unsigned char *key, IdeaKS *ks) const
void SetDecKey (const unsigned char *key, IdeaKS *ks) const
void Decrypt (unsigned char *data, int len, IdeaKS *ks, unsigned char *iv) const
int Encrypt (const unsigned char *data, int len, unsigned char *crypt, IdeaKS *ks, unsigned char *iv) const
void EcbEncrypt (const unsigned char *data, int len, unsigned char *crypt, IdeaKS *ks) const
void Decrypt (unsigned char *data, int len, const unsigned char *key, unsigned char *iv) const
void Decrypt (const unsigned char *data, int len, unsigned char *decrypt, const unsigned char *key, unsigned char *iv) const
int Encrypt (const unsigned char *data, int len, unsigned char *crypt, const unsigned char *key, unsigned char *iv) const
void SetEncKey (const unsigned char *key, IdeaKS *ks) const
void SetDecKey (const unsigned char *key, IdeaKS *ks) const
void Decrypt (unsigned char *data, int len, IdeaKS *ks, unsigned char *iv) const
int Encrypt (const unsigned char *data, int len, unsigned char *crypt, IdeaKS *ks, unsigned char *iv) const
void EcbEncrypt (const unsigned char *data, int len, unsigned char *crypt, IdeaKS *ks) const

Detailed Description

Definition at line 112 of file crypto.h.


Member Function Documentation

void cIDEA::Decrypt ( unsigned char *  data,
int  len,
const unsigned char *  key,
unsigned char *  iv 
) const

Definition at line 97 of file crypto.c.

References idea_cbc_encrypt(), IDEA_DECRYPT, and idea_set_encrypt_key().

Referenced by cN2Prov0101::Algo(), cNagra2::CreatePQ(), cCamCryptNagra::DecryptCW(), cCamCryptNagra::DecryptDT08(), cNagra2::DecryptECM(), and cNagra2::DecryptEMM().

{
  unsigned char v[8];
  if(!iv) { memset(v,0,sizeof(v)); iv=v; }
  IDEA_KEY_SCHEDULE ks;
  idea_set_encrypt_key(key,&ks);
  idea_cbc_encrypt(data,data,len&~7,&ks,iv,IDEA_DECRYPT);
}
void cIDEA::Decrypt ( const unsigned char *  data,
int  len,
unsigned char *  decrypt,
const unsigned char *  key,
unsigned char *  iv 
) const

Definition at line 106 of file crypto.c.

References idea_cbc_encrypt(), IDEA_DECRYPT, and idea_set_encrypt_key().

{
  unsigned char v[8];
  if(!iv) { memset(v,0,sizeof(v)); iv=v; }
  IDEA_KEY_SCHEDULE ks;
  idea_set_encrypt_key(key,&ks);
  idea_cbc_encrypt(data,decrypt,len&~7,&ks,iv,IDEA_DECRYPT);
}
void cIDEA::Decrypt ( unsigned char *  data,
int  len,
const unsigned char *  key,
unsigned char *  iv 
) const
void cIDEA::Decrypt ( const unsigned char *  data,
int  len,
unsigned char *  decrypt,
const unsigned char *  key,
unsigned char *  iv 
) const
void cIDEA::Decrypt ( unsigned char *  data,
int  len,
IdeaKS *  ks,
unsigned char *  iv 
) const

Definition at line 138 of file crypto.c.

References idea_cbc_encrypt(), and IDEA_DECRYPT.

{
  unsigned char v[8];
  if(!iv) { memset(v,0,sizeof(v)); iv=v; }
  idea_cbc_encrypt(data,data,len&~7,ks,iv,IDEA_DECRYPT);
}
void cIDEA::Decrypt ( unsigned char *  data,
int  len,
IdeaKS *  ks,
unsigned char *  iv 
) const
void cIDEA::EcbEncrypt ( const unsigned char *  data,
int  len,
unsigned char *  crypt,
IdeaKS *  ks 
) const
void cIDEA::EcbEncrypt ( const unsigned char *  data,
int  len,
unsigned char *  crypt,
IdeaKS *  ks 
) const

Definition at line 153 of file crypto.c.

References idea_ecb_encrypt().

Referenced by cCmd0cCrypt::Decrypt().

{
  len/=8;
  while(len>0) {
    idea_ecb_encrypt(data,crypt,ks);
    data+=8;
    crypt+=8;
    }
}
int cIDEA::Encrypt ( const unsigned char *  data,
int  len,
unsigned char *  crypt,
const unsigned char *  key,
unsigned char *  iv 
) const
int cIDEA::Encrypt ( const unsigned char *  data,
int  len,
unsigned char *  crypt,
IdeaKS *  ks,
unsigned char *  iv 
) const

Definition at line 145 of file crypto.c.

References idea_cbc_encrypt(), and IDEA_ENCRYPT.

{
  unsigned char v[8];
  if(!iv) { memset(v,0,sizeof(v)); iv=v; }
  idea_cbc_encrypt(data,crypt,len&~7,ks,iv,IDEA_ENCRYPT);
  return len;
}
int cIDEA::Encrypt ( const unsigned char *  data,
int  len,
unsigned char *  crypt,
IdeaKS *  ks,
unsigned char *  iv 
) const
int cIDEA::Encrypt ( const unsigned char *  data,
int  len,
unsigned char *  crypt,
const unsigned char *  key,
unsigned char *  iv 
) const

Definition at line 115 of file crypto.c.

References idea_cbc_encrypt(), IDEA_ENCRYPT, and idea_set_encrypt_key().

Referenced by cN2Prov::ExpandInput(), and cN2Prov::MECM().

{
  unsigned char v[8];
  if(!iv) { memset(v,0,sizeof(v)); iv=v; }
  len&=~7;
  IDEA_KEY_SCHEDULE ks;
  idea_set_encrypt_key(key,&ks);
  idea_cbc_encrypt(data,crypt,len,&ks,iv,IDEA_ENCRYPT);
  return len;
}
void cIDEA::SetDecKey ( const unsigned char *  key,
IdeaKS *  ks 
) const
void cIDEA::SetDecKey ( const unsigned char *  key,
IdeaKS *  ks 
) const
void cIDEA::SetEncKey ( const unsigned char *  key,
IdeaKS *  ks 
) const
void cIDEA::SetEncKey ( const unsigned char *  key,
IdeaKS *  ks 
) const

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