]> www.vanbest.org Git - sasc-ng.git/commitdiff
nagra-0101: Imap21
authoranon <unknown>
Sun, 8 Jun 2008 04:26:24 +0000 (12:26 +0800)
committeranon <unknown>
Sun, 8 Jun 2008 04:26:24 +0000 (12:26 +0800)
systems/nagra/nagra2-0101.c
systems/nagra/nagra2.c
systems/nagra/nagra2.h

index 5839dcba75ae55703cbb4aa70e09d1646274984e..f131e636b5fc0e4fd21f4135250ff22b35b60bd4 100644 (file)
@@ -431,6 +431,17 @@ void cMap0101::DoMap(int f, unsigned char *data, int l)
   l=GetOpSize(l);
   cycles=0; interrupted=false;
   switch(f) {
+    case 0x21:
+      MAP_IRQ_BEGIN();
+      AddMapCycles(288);
+      WS_START(1);
+      MakeJ0(J,D);
+      AddMapCycles(282);
+      WClear(C);
+      AddMapCycles(898-282-288);
+      WS_END();
+      MAP_IRQ_END();
+      break;     
     case 0x22:
       {
       int shift=((-l)&0xFF00)>>8, exp=(-l)&0x1F;
@@ -847,6 +858,7 @@ bool cN2Prov0101::ProcessMap(int f)
       GetMem(HILO(0x44),tmp,dl,0);
       DoMap(f,tmp,l);
       break;
+    case 0x21:
     case 0x30:
     case 0x31:
     case 0x43:
index df986ab2b0d64684cda6e04c8077757f5e9c82c9..6e4ca8ba27b5e9ee080d18c096774a7c4db4e60f 100644 (file)
@@ -265,6 +265,13 @@ cMapMath::cMapMath(void)
   wordsize=DEF_WORDSIZE;
 }
 
+void cMapMath::WClear(BIGNUM *r, int w)
+{
+  if(!w) w=wordsize;
+  BN_rshift(r,r,w<<6);
+  BN_lshift(r,r,w<<6);
+}
+
 bool cMapMath::ModAdd(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *d)
 {
   BN_add(r,a,b);
index f78b29810eb2b47938116f1930501b6c9f753060..30cf002d77ed1bf81f4134352f7759099cadae25 100644 (file)
@@ -71,6 +71,7 @@ protected:
   void MonMul(BIGNUM *o, BIGNUM *a, BIGNUM *b, BIGNUM *c, BIGNUM *d, BIGNUM *j, int w);
   void MonStart(int w);
   void MonLoop(BIGNUM *o, BIGNUM *a, BIGNUM *b, BIGNUM *c, BIGNUM *d, BIGNUM *j);
+  void WClear(BIGNUM *r, int w=0);
   // statefull
   void MonMul(BIGNUM *o, BIGNUM *a, BIGNUM *b);
   void MonMul(BIGNUM *o, BIGNUM *a, BIGNUM *b, int w);