# R3:a R4:p R5:q R6:m $R3 = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A73D8F51EB3B05798DD885BCD1D56DE6D94BD9ECAE8AB062AC451CE83390732974D50DFF50B374AC28AC48118E4E8F9DD633A4C3B1FD2B6E825EA4B2E57C7351 $R4 = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C64DD301CCD5CC993833B8DC531D58B9AB4E39FE5313A08E208E02B7EDA8FD8D6CD96D5B199E16A982CECAF61734C871342140838AB5881EE86C57D399EA8103 $R5 = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C12354640F12A3A703C9660A4D30D97048BF0E3AEDE05E1442C4633721870FB42BA39DB7267666B5999A28321BE6E79EECF4F438F0FB78B34660687C23BE2B31 $R6 = 15F236DD65047B6BE8FC92DF77DDBEE7C106EC72DB01F127661654E8E3454EC21FB63230B62DD729266B5EC005444F570E0C084E0D5AF3BE68041199A17C9BB2CEFEF2CFEC36AFD15E6D0F9CE7C5561843565A0916F441C2C8A095A175DBD50E68A341190F00E3306A8FB482D0BC9FE3CC9F70C4700C9EEDF50ADA88B5C72A60 # R11:y1 R12:y2 # R15:d $R15= 0026AB0345FF1905ACDA929A20DB4DA7ED306434BBF34B7FA1432E0A2A1CBE49E910D1505CD3B4214B1DFA12AE5041FAB0BEB4DF9CCC692BC9D9B65011DC365FA384C61043DC445ACC751E29CBE654FD10383DE276B3F0DD685EB293188E5523A9F91EF20BACF757BB3A03372DB4C66523541906F846F519F6E6A3F5F7D4E5D1 START: #S3 X=15 SEL(X);B=SEL2;X=4 SEL(X);A=SEL1 ADDL=A;INV;D=SEL2 A=SEL1;J=512 DIV3: ADDL=DIVA;ADDR=D;CMP;SUB;INV;A=SEL3;B=SEL3;C=SEL3;BJ(DIV3) ADDL=DIVA;ADDR=D;CMP;SUB;INV;A=SEL3;B=SEL3;C=SEL3 R2=A #S1 X=6 SEL(X);B=SEL2;X=4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2;X=3 J=512;SEL(X);C=SEL2 BMUL3: ADDL=A;ADDR=B;MUL;B=SEL1;C=SEL1;BJ(BMUL3) ADDL=A;ADDR=B;MUL;B=SEL1;C=SEL1 X=5 SEL(X);D=SEL2 A=SEL1;J=1024 DIV6: ADDL=DIVA;ADDR=D;CMP;SUB;INV;A=SEL3;B=SEL3;C=SEL3;BJ(DIV6) ADDL=DIVA;ADDR=D;CMP;SUB;INV;A=SEL3;B=SEL3;C=SEL3 X=4 SEL(X);C=SEL2;X=11 SEL(X);B=SEL2 J=512 BMUL4: ADDL=A;ADDR=B;MUL;B=SEL1;C=SEL1;BJ(BMUL4) ADDL=A;ADDR=B;MUL;B=SEL1;C=SEL1 ADDR=C;A=SEL1 R14=A END(0);@R14 ################################### # RSA512 # A = R1 ^ R2 mod R0 ################################### RSA512: X=0 SEL(X);C=SEL2;D=SEL2;X=1 SEL(X);B=SEL2 A=SEL1;C=SEL2;I<=512 XDIV: ADDL=DIVA;ADDR=D;CMP;SUB;INV;A=SEL3;B=SEL3;C=SEL3;BI(XDIV) ADDL=DIVA;ADDR=D;CMP;SUB;INV;A=SEL3;B=SEL3;C=SEL3 D=SEL1;SUB;A=SEL1;X=0 SEL (X);B=SEL2;X=2 SEL (X);C=SEL2;MRES I<=128;XCOUNT XLBL1: XCOUNT;MMUL;BI(XLBL1) XCOUNT;MMUL MMUL;MRES;MUL;D=SEL1;A=SEL1 CMP;SUB;INV;ADDL=A;ADDR=B;A=SEL1;BC(XLBL2) D=SEL1;ADDR=D;A=SEL1 MMUL;MRES;A=SEL1 CMP;SUB;INV;ADDL=A;ADDR=B;A=SEL1 XLBL2: BJ(XLBL1);MRES C=SEL1;I<=128;XCOUNT RET NOP