|
SASC
DVBSoftCAM
|
#include <stdlib.h>#include <string.h>#include <stdio.h>#include "crypto.h"#include "helper.h"#include "log.h"#include "support/i_cbc.c"#include "support/i_ecb.c"#include "support/i_skey.c"#include "support/aes_core.c"Go to the source code of this file.
Defines | |
| #define | shiftin(V, R, n) ((V<<1)+(((R)>>(n))&1)) |
| #define | rol28(V, n) ((V<<(n) ^ V>>(28-(n)))&0xfffffffL) |
| #define | ror28(V, n) ((V>>(n) ^ V<<(28-(n)))&0xfffffffL) |
| #define | hash(T) ((T&0x0000ffffL) | ((T>>8)&0x00ff0000L) | ((T<<8)&0xff000000L)) |
| #define | DESROUND(C, D, T) |
| #define | DESHASH(T) { if(mode&DES_HASH) T=hash(T); } |
| #define | RC6_WORDSIZE 32 |
| #define | RC6_P32 0xB7E15163L |
| #define | RC6_Q32 0x9E3779B9L |
Functions | |
| void | RotateBytes (unsigned char *out, const unsigned char *in, int n) |
| void | RotateBytes (unsigned char *in, int n) |
| #define DESHASH | ( | T | ) | { if(mode&DES_HASH) T=hash(T); } |
Definition at line 340 of file crypto.c.
Referenced by cDes::Des().
| #define DESROUND | ( | C, | |
| D, | |||
| T | |||
| ) |
{ \
unsigned int s=0; \
for(int j=7, k=0; j>=0; j--) { \
unsigned int v=0, K=0; \
for(int t=5; t>=0; t--, k++) { \
v=shiftin(v,T,E[k]); \
if(PC2[k]<29) K=shiftin(K,C,28-PC2[k]); \
else K=shiftin(K,D,56-PC2[k]); \
} \
s=(s<<4) + S[7-j][v^K]; \
} \
T=0; \
for(int j=31; j>=0; j--) T=shiftin(T,s,P[j]); \
}
Definition at line 325 of file crypto.c.
Referenced by cDes::Des().
| #define hash | ( | T | ) | ((T&0x0000ffffL) | ((T>>8)&0x00ff0000L) | ((T<<8)&0xff000000L)) |
Definition at line 322 of file crypto.c.
Referenced by cHashBase::Add(), cSeca2Prov::cSeca2Prov(), cSeca2Prov::Init(), cSystemFakeNDS::ProcessECM(), cSystemConax::ProcessECM(), cNagraDES::SigCheck(), cSeca2Prov::T1(), cSeca2Prov::T2(), and cSeca2Prov::~cSeca2Prov().
| #define RC6_P32 0xB7E15163L |
Definition at line 460 of file crypto.c.
Referenced by cRC6::SetKey().
| #define RC6_Q32 0x9E3779B9L |
Definition at line 461 of file crypto.c.
Referenced by cRC6::SetKey().
| #define rol28 | ( | V, | |
| n | |||
| ) | ((V<<(n) ^ V>>(28-(n)))&0xfffffffL) |
Definition at line 307 of file crypto.c.
Referenced by cDes::Des().
| #define ror28 | ( | V, | |
| n | |||
| ) | ((V>>(n) ^ V<<(28-(n)))&0xfffffffL) |
Definition at line 308 of file crypto.c.
Referenced by cDes::Des().
| #define shiftin | ( | V, | |
| R, | |||
| n | |||
| ) | ((V<<1)+(((R)>>(n))&1)) |
Definition at line 306 of file crypto.c.
Referenced by cDes::Permute().
| void RotateBytes | ( | unsigned char * | out, |
| const unsigned char * | in, | ||
| int | n | ||
| ) |