#include <nagra2.h>
List of all members.
Public Member Functions |
| | cMapReg (int &_pos, int *_defwordsize=0, int _maxwordsize=DEF_MAXWORDSIZE) |
| | operator BIGNUM * () |
| BIGNUM * | operator-> () |
| BIGNUM * | Value (int wsize=0, bool mask=false) |
| void | Commit (int wsize=-1, int resync=-1) |
| void | Reload (int wsize=0) |
| void | GetLE (const unsigned char *in, int n=0) |
| void | PutLE (unsigned char *out, int n=0) |
| void | Set (BIGNUM *val, int wsize) |
| void | Clear (int wsize) |
| void | SetPos (int _pos) |
| | cMapReg (int &_pos, int *_defwordsize=0, int _maxwordsize=DEF_MAXWORDSIZE) |
| | operator BIGNUM * () |
| BIGNUM * | operator-> () |
| BIGNUM * | Value (int wsize=0, bool mask=false) |
| void | Commit (int wsize=-1, int resync=-1) |
| void | Reload (int wsize=0) |
| void | GetLE (const unsigned char *in, int n=0) |
| void | PutLE (unsigned char *out, int n=0) |
| void | Set (BIGNUM *val, int wsize) |
| void | Clear (int wsize) |
| void | SetPos (int _pos) |
Protected Member Functions |
| void | SetMaxWordSize (int max) |
| void | SetDefWordSize (int *_defwordsize) |
| void | SetMaxWordSize (int max) |
| void | SetDefWordSize (int *_defwordsize) |
Detailed Description
Definition at line 56 of file nagra2.h.
Constructor & Destructor Documentation
| cMapReg::cMapReg |
( |
int & |
_pos, |
|
|
int * |
_defwordsize = 0, |
|
|
int |
_maxwordsize = DEF_MAXWORDSIZE |
|
) |
| |
| cMapReg::cMapReg |
( |
int & |
_pos, |
|
|
int * |
_defwordsize = 0, |
|
|
int |
_maxwordsize = DEF_MAXWORDSIZE |
|
) |
| |
Member Function Documentation
| void cMapReg::Clear |
( |
int |
wsize | ) |
|
Definition at line 458 of file nagra2.c.
References Commit().
{
wsize=OpWordSize(wsize);
if(wordsize!=wsize) {
Commit();
ClearFullReg(wsize);
}
ClearReg(wsize);
}
| void cMapReg::Clear |
( |
int |
wsize | ) |
|
| void cMapReg::Commit |
( |
int |
wsize = -1, |
|
|
int |
resync = -1 |
|
) |
| |
| void cMapReg::Commit |
( |
int |
wsize = -1, |
|
|
int |
resync = -1 |
|
) |
| |
Definition at line 400 of file nagra2.c.
Referenced by Clear(), GetLE(), cMap0101::Map(), PutLE(), Set(), and Value().
{
if(resync<0 && wsize<0) resync=1;
wsize=OpWordSize(wsize>=0?wsize:wordsize);
ClearFullReg(wsize);
PrepTmp(reg,wsize);
BN_add(fullreg,fullreg,tmp);
if(resync) {
if(wordsize==wsize) BN_mask_bits(reg,wsize*64);
else wordsize=wsize;
}
}
| void cMapReg::GetLE |
( |
const unsigned char * |
in, |
|
|
int |
n = 0 |
|
) |
| |
| void cMapReg::GetLE |
( |
const unsigned char * |
in, |
|
|
int |
n = 0 |
|
) |
| |
| cMapReg::operator BIGNUM * |
( |
| ) |
[inline] |
| cMapReg::operator BIGNUM * |
( |
| ) |
[inline] |
| BIGNUM* cMapReg::operator-> |
( |
| ) |
[inline] |
| BIGNUM* cMapReg::operator-> |
( |
| ) |
[inline] |
| void cMapReg::PutLE |
( |
unsigned char * |
out, |
|
|
int |
n = 0 |
|
) |
| |
Definition at line 430 of file nagra2.c.
References Commit(), i, and cBN::PutLE().
Referenced by cMap0101::Map().
{
int wsize=OpWordSize(n<=0?n:(n+7)/8);
Commit();
fullreg.PutLE(out,wsize*8);
if(pos&7) {
int s=pos/8*8;
for(int i=0; i<(pos&7); i++) {
unsigned char c=out[s];
memmove(out+s,out+s+1,7);
out[s+7]=c;
}
}
}
| void cMapReg::PutLE |
( |
unsigned char * |
out, |
|
|
int |
n = 0 |
|
) |
| |
| void cMapReg::Reload |
( |
int |
wsize = 0 | ) |
|
| void cMapReg::Reload |
( |
int |
wsize = 0 | ) |
|
Definition at line 413 of file nagra2.c.
Referenced by Value().
{
wsize=OpWordSize(wsize>=0?wsize:wordsize);
wordsize=wsize;
BN_copy(reg,fullreg);
BN_mask_bits(reg,64*wsize);
}
| void cMapReg::Set |
( |
BIGNUM * |
val, |
|
|
int |
wsize |
|
) |
| |
Definition at line 445 of file nagra2.c.
References Commit().
{
wsize=OpWordSize(wsize);
if(wordsize!=wsize) Commit();
ClearReg(wsize);
PrepTmp(val,wsize);
if(wordsize!=wsize) {
ClearFullReg(wsize);
BN_add(fullreg,fullreg,tmp);
}
BN_add(reg,reg,tmp);
}
| void cMapReg::Set |
( |
BIGNUM * |
val, |
|
|
int |
wsize |
|
) |
| |
| void cMapReg::SetDefWordSize |
( |
int * |
_defwordsize | ) |
[inline, protected] |
Definition at line 69 of file nagra2.h.
{ defwordsize=_defwordsize; }
| void cMapReg::SetDefWordSize |
( |
int * |
_defwordsize | ) |
[inline, protected] |
| void cMapReg::SetMaxWordSize |
( |
int |
max | ) |
[inline, protected] |
| void cMapReg::SetMaxWordSize |
( |
int |
max | ) |
[inline, protected] |
| void cMapReg::SetPos |
( |
int |
_pos | ) |
[inline] |
| void cMapReg::SetPos |
( |
int |
_pos | ) |
[inline] |
| BIGNUM* cMapReg::Value |
( |
int |
wsize = 0, |
|
|
bool |
mask = false |
|
) |
| |
| BIGNUM * cMapReg::Value |
( |
int |
wsize = 0, |
|
|
bool |
mask = false |
|
) |
| |
The documentation for this class was generated from the following files:
- contrib/sasc-ng/sc/PLUGINS/src/sc-src/systems/nagra/nagra2.h
- systems/nagra/nagra2.h
- contrib/sasc-ng/sc/PLUGINS/src/sc-src/systems/nagra/nagra2.c
- systems/nagra/nagra2.c