# R3:a R4:p R5:q R6:m $R3 = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000085E6AD20DDD885933EBC9FDD6DE1C3D755CC135C51D6B7E9DFE70F38EE914DBCD5506BD057662E494DD421C1E71CE36F3D650AF0FFD9F244C4A155BDC6A64507 $R4 = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C3ABF5E1BC334AF85FAE0C2B3FB424ECC9ECD2175CC72EAC6AEC2C45C9F045C2681EDA57D6A6E0267954B7E13CBFCF6497E83D319B7C6782BD31B72034307CBF $R5 = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C514BF027FC9CAA20F8AD51DD80CB618E28A44FB4F6DFB6C1EB34EA6FBC50EF0AD727A8C48F1C21BE4CDBFC9F19628C411A59F9EAD6957F40B897F42D5848531 $R6 = 1ACE20F3C89234CBB7212B92CCE2A0C92D46BC316DF3F20F4BD513C830447A5A7A778A35C23A925E4134424789E66D33540DBB28CDA7E3F2FA6A967FB03B7AAE1BEF9D87CD747A6FE421C4A5F3F891AF1CE130451BB3BBF49078F35ED730FDA21C87E83E0825A6F7B8481829A238F7D5EC1BAF4651D878E124E15185A871466D # R11:y1 R12:y2 # R15:d $R15= 167ABBBD74B0920153AFB62454A32F6C17F321E6D4479282355898E500FD8CC768B29E0B59E2DCD3815D0131EF460C9AD5EFF6D13ABC1D19FADC5BFD3151F0B7C9FAB4129B06D3626AAD4CA10F1AC1623B825962F522CDF929B92A545EA17F61746927B8EDF01C0A0D847E85BC98AE75C24096F265E71A8FCA80B854E469F481 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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L1 PLUS: B=SEL2;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