]> www.vanbest.org Git - sasc-ng.git/commitdiff
nagra 0101: fixup map3b implementation
authoranisota <unknown>
Sun, 13 Jan 2008 19:48:21 +0000 (20:48 +0100)
committeranisota <unknown>
Sun, 13 Jan 2008 19:48:21 +0000 (20:48 +0100)
systems/nagra/nagra2-0101.c
systems/nagra/nagra2.c

index ac4842a22d91889414932a1fdcfd260f2b699676..c0ef8e7ee123ba532e1ca98d8876d7f96a9a5686 100644 (file)
@@ -436,8 +436,10 @@ void cMap0101::DoMap(int f, unsigned char *data, int l)
       break;
       }
     case 0x3b:
-      MonInit(132); // or 66*wordsize ?
-      MonMul(B,A,B);
+      if(!l) l=wordsize;
+      MonInit(wordsize*60+4*l);
+      I.GetLE(data,l<<3);
+      MonMul(B,I,B);
       break;
     case 0x3e:
       {
@@ -749,6 +751,11 @@ bool cN2Prov0101::ProcessMap(int f)
       DoMap(f,tmp,-((Get(0x48)<<16)|(Get(0x49)<<8)|Get(0x4a)));
       AddCycles(MapCycles());
       break;
+    case 0x3b:
+      size=Get(0x48); if(!size) size=wordsize;
+      GetMem(HILO(0x44),tmp,size<<3,0);
+      DoMap(f,tmp,size);
+      break;
     case 0x3e:
       GetMem(HILO(0x44),tmp,size,0);
       DoMap(f,tmp,Get(0x48));
index 425da390336589e1044b25355af845b5c45a833a..61180c44bd285611cd47016e9baa44209b1d6aa4 100644 (file)
@@ -268,7 +268,7 @@ void cMapCore::MakeJ0(BIGNUM *j, BIGNUM *d)
 
 void cMapCore::MonMul(BIGNUM *o, BIGNUM *a, BIGNUM *b, BIGNUM *c, BIGNUM *d, BIGNUM *j)
 {
-  int words=(BN_num_bytes(d)+7)>>3;
+  int words=(BN_num_bytes(a)+7)>>3;
   BN_zero(s);
   for(int i=0; i<words;) {
     BN_rshift(x,a,(i++)<<6);