3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @author www.Tutorialspots.com * @copyright 2017 */ class RC5{ public static $S = array(); public static $r = 12; public static $w = 32; private static function cyclicShiftLeft($array, $positions) { $temp = array_slice($array, 0, $positions); $temp = array_merge(array_slice($array, $positions), $temp); return $temp; } private static function ROTL($v,$n,$m=32) { $y = sprintf("%0".$m."b",$v); $r = str_split($y); $r = self::cyclicShiftLeft($r,$n); return bindec(implode("",$r)) ; } private static function ROTR($v,$n,$m=32){ return self::ROTL($v,$m-$n,$m); } /* Key scheduling */ public static function rc5_init($K) { $b = 16; $u = self::$w/8; $c = max(1, ceil($b/$u)); $t = 2 * (self::$r+1); $L = array(); $P = 0xb7e15163; $Q = 0x9e3779b9; for($i = 0; $i < $b; $i++) $L[$i] = 0; for($i = $b-1, $L[$c-1] = 0; $i != -1; $i--) $L[$i/$u] = ($L[$i/$u] << 8) + ord($K[$i]);/////////////////// for(self::$S[0] = $P, $i = 1; $i < $t; $i++) self::$S[$i] = self::$S[$i-1] + $Q; $n = max($t,$c); for($A = $B = $i = $j = $k = 0; $k < 3 * $n; $k++, $i = ($i+1) % $t, $j = ($j+1) % $c) { $A = self::$S[$i] = self::ROTL(self::$S[$i] + ($A + $B), 3, self::$w); $B = $L[$j] = self::ROTL($L[$j] + ($A + $B), ($A + $B)&(self::$w-1), self::$w); } } public static function rc5_encrypt($pt) { $A = $pt[0] + self::$S[0]; $B = $pt[1] + self::$S[1]; for($i = 1; $i <= self::$r; $i++) { $A = self::ROTL($A ^ $B, $B&(self::$w-1), self::$w) + self::$S[2*$i]; $B = self::ROTL($B ^ $A, $A&(self::$w-1), self::$w) + self::$S[2*$i + 1]; } return array($A & (pow(2,self::$w)-1), $B & (pow(2,self::$w)-1)); } public static function rc5_decrypt($ct) { $B=$ct[1]; $A=$ct[0]; for($i = self::$r; $i > 0; $i--) { $B = self::ROTR($B - self::$S[2*$i + 1], $A&(self::$w-1), self::$w) ^ $A; $A = self::ROTR($A - self::$S[2*$i], $B&(self::$w-1), self::$w) ^ $B; } return array(($A - self::$S[0]) & (pow(2,self::$w)-1), ($B - self::$S[1]) & (pow(2,self::$w)-1)); } private static function _nullpadding($str,$length=16){ if(strlen($str)%$length != 0){ $str .= str_repeat(chr(0),$length-strlen($str)%$length); } return $str; } private static function key($key){ for ($s = array(), $i = 0; $i < 256; $i++) $s[$i] = $i; for ($j = 0, $i = 0; $i < 256; $i++) { $j = ($j + $s[$i] + ord($key[$i % strlen($key)])) % 256; $x = $s[$i]; $s[$i] = $s[$j]; $s[$j] = $x; } return $s; } // convert 32bits interger to 4characters string private static function _32bits2str($block){ return pack('N',$block & 0xffffffff); } // convert 4characters string to 32bits interger private static function _str232bits($block){ $dd=unpack('N*',$block); return $dd[1]; } //Stream cipher encrypt use RC5 public static function RC5enc($str,$key,$mode='ECB'){ $str = self::_nullpadding($str, 8);//var_dump($str);die(); $enc = ''; $k = self::key($key); //var_dump($k);die(); //self::rc5_init($k); for($i=0;$i<strlen($str)/8;$i++){ $block = substr($str,$i*8,8); $chr = array(self::_str232bits(substr($block,0,4)),self::_str232bits(substr($block,4,4))); $e = self::rc5_encrypt($chr); $enc .= self::_32bits2str($e[0]).self::_32bits2str($e[1]); } return $enc; } //Stream cipher decrypt use RC5 public static function RC5dec($str,$key,$mode='ECB'){ $enc = ''; $k = self::key($key); //self::rc5_init($k); for($i=0;$i<strlen($str)/8;$i++){ $block = substr($str,$i*8,8); $chr = array(self::_str232bits(substr($block,0,4)),self::_str232bits(substr($block,4,4))); $e = self::rc5_decrypt($chr); $enc .= self::_32bits2str($e[0]).self::_32bits2str($e[1]); } return rtrim($enc,chr(0)); } } $input="\xC8\x83\x11\xCE\x7F\x2D\xB0\x1E"; $keyy="\x73\xE6\x31\x48\x43\x57\x62\xCC\xA9\x3A\xCD\x55\x39\x4A\xC6\xF1"; // iv and key $input="\xEE\xDB\xA5\x21\x6D\x8F\x4B\x15"; $keyy="\x91\x5F\x46\x19\xBE\x41\xB2\x51\x63\x55\xA5\x01\x10\xA9\xCE\x91"; //dcp test case $input="\xB7\xB3\x42\x2F\x92\xFC\x69\x03"; $keyy="\xDC\x49\xDB\x13\x75\xA5\x58\x4F\x64\x85\xB4\x13\xB5\xF1\x2B\xAF"; //dcp test case //RC5::rc5_init(array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)); //RC5::rc5_init(array(220,73,219,19,117,165,88,79,100,133,180,19,181,241,43,175)); RC5::rc5_init(str_split($keyy)); //$enc = (RC5::RC5enc("\x21\xA5\xDB\xEE\x15\x4B\x8F\x6D","\x91\x5F\x46\x19\xBE\x41\xB2\x51\x63\x55\xA5\x01\x10\xA9\xCE\x91")); $enc = (RC5::RC5enc($input,$keyy)); //$dec = (RC5::rc5_decrypt( $enc )); echo base64_encode($enc); echo $enc; $dec = (RC5::RC5dec($enc,$keyy)); var_dump(base64_encode($enc),$dec); //RC5enc("aaaaaaaaaaa","4124bc0a9335c27f"); echo "\x41\x41"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CRKNZ
function name:  (null)
number of ops:  36
compiled vars:  !0 = $input, !1 = $keyy, !2 = $enc, !3 = $dec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  151     0  E >   ASSIGN                                                   !0, '%C8%83%11%CE%7F-%B0%1E'
  152     1        ASSIGN                                                   !1, 's%E61HCWb%CC%A9%3A%CDU9J%C6%F1'
  155     2        ASSIGN                                                   !0, '%EE%DB%A5%21m%8FK%15'
  156     3        ASSIGN                                                   !1, '%91_F%19%BEA%B2QcU%A5%01%10%A9%CE%91'
  158     4        ASSIGN                                                   !0, '%B7%B3B%2F%92%FCi%03'
  159     5        ASSIGN                                                   !1, '%DCI%DB%13u%A5XOd%85%B4%13%B5%F1%2B%AF'
  163     6        INIT_STATIC_METHOD_CALL                                  'RC5', 'rc5_init'
          7        INIT_FCALL                                               'str_split'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $10     
         10        SEND_VAR                                                 $10
         11        DO_FCALL                                      0          
  166    12        INIT_STATIC_METHOD_CALL                                  'RC5', 'RC5enc'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !1
         15        DO_FCALL                                      0  $12     
         16        ASSIGN                                                   !2, $12
  168    17        INIT_FCALL                                               'base64_encode'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $14     
         20        ECHO                                                     $14
  169    21        ECHO                                                     !2
  170    22        INIT_STATIC_METHOD_CALL                                  'RC5', 'RC5dec'
         23        SEND_VAR                                                 !2
         24        SEND_VAR                                                 !1
         25        DO_FCALL                                      0  $15     
         26        ASSIGN                                                   !3, $15
  171    27        INIT_FCALL                                               'var_dump'
         28        INIT_FCALL                                               'base64_encode'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                         $17     
         31        SEND_VAR                                                 $17
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                                 
  173    34        ECHO                                                     'AA'
  174    35      > RETURN                                                   1

Class RC5:
Function cyclicshiftleft:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CRKNZ
function name:  cyclicShiftLeft
number of ops:  19
compiled vars:  !0 = $array, !1 = $positions, !2 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        INIT_FCALL                                               'array_slice'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !2, $3
   16     8        INIT_FCALL                                               'array_merge'
          9        INIT_FCALL                                               'array_slice'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $6      
         16        ASSIGN                                                   !2, $6
   17    17      > RETURN                                                   !2
   18    18*     > RETURN                                                   null

End of function cyclicshiftleft

Function rotl:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CRKNZ
function name:  ROTL
number of ops:  28
compiled vars:  !0 = $v, !1 = $n, !2 = $m, !3 = $y, !4 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      32
   21     3        INIT_FCALL                                               'sprintf'
          4        CONCAT                                           ~5      '%250', !2
          5        CONCAT                                           ~6      ~5, 'b'
          6        SEND_VAL                                                 ~6
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !3, $7
   22    10        INIT_FCALL                                               'str_split'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !4, $9
   23    14        INIT_STATIC_METHOD_CALL                                  'cyclicShiftLeft'
         15        SEND_VAR                                                 !4
         16        SEND_VAR                                                 !1
         17        DO_FCALL                                      0  $11     
         18        ASSIGN                                                   !4, $11
   24    19        INIT_FCALL                                               'bindec'
         20        INIT_FCALL                                               'implode'
         21        SEND_VAL                                                 ''
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                         $13     
         24        SEND_VAR                                                 $13
         25        DO_ICALL                                         $14     
         26      > RETURN                                                   $14
   25    27*     > RETURN                                                   null

End of function rotl

Function rotr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CRKNZ
function name:  ROTR
number of ops:  11
compiled vars:  !0 = $v, !1 = $n, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      32
   28     3        INIT_STATIC_METHOD_CALL                                  'ROTL'
          4        SEND_VAR                                                 !0
          5        SUB                                              ~3      !2, !1
          6        SEND_VAL                                                 ~3
          7        SEND_VAR                                                 !2
          8        DO_FCALL                                      0  $4      
          9      > RETURN                                                   $4
   29    10*     > RETURN                                                   null

End of function rotr

Function rc5_init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 23
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 34
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 53
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 111
Branch analysis from position: 111
2 jumps found. (Code = 44) Position 1 = 114, Position 2 = 74
Branch analysis from position: 114
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 74
2 jumps found. (Code = 44) Position 1 = 114, Position 2 = 74
Branch analysis from position: 114
Branch analysis from position: 74
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 53
Branch analysis from position: 63
Branch analysis from position: 53
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 34
Branch analysis from position: 48
Branch analysis from position: 34
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 23
Branch analysis from position: 28
Branch analysis from position: 23
filename:       /in/CRKNZ
function name:  rc5_init
number of ops:  115
compiled vars:  !0 = $K, !1 = $b, !2 = $u, !3 = $c, !4 = $t, !5 = $L, !6 = $P, !7 = $Q, !8 = $i, !9 = $n, !10 = $A, !11 = $B, !12 = $j, !13 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   34     1        ASSIGN                                                   !1, 16
   35     2        FETCH_STATIC_PROP_R          unknown             ~15     'w'
          3        DIV                                              ~16     ~15, 8
          4        ASSIGN                                                   !2, ~16
   36     5        INIT_FCALL                                               'max'
          6        SEND_VAL                                                 1
          7        INIT_FCALL                                               'ceil'
          8        DIV                                              ~18     !1, !2
          9        SEND_VAL                                                 ~18
         10        DO_ICALL                                         $19     
         11        SEND_VAR                                                 $19
         12        DO_ICALL                                         $20     
         13        ASSIGN                                                   !3, $20
   37    14        FETCH_STATIC_PROP_R          unknown             ~22     'r'
         15        ADD                                              ~23     ~22, 1
         16        MUL                                              ~24     ~23, 2
         17        ASSIGN                                                   !4, ~24
   38    18        ASSIGN                                                   !5, <array>
   39    19        ASSIGN                                                   !6, 3084996963
   40    20        ASSIGN                                                   !7, 2654435769
   42    21        ASSIGN                                                   !8, 0
         22      > JMP                                                      ->26
   43    23    >   ASSIGN_DIM                                               !5, !8
         24        OP_DATA                                                  0
   42    25        PRE_INC                                                  !8
         26    >   IS_SMALLER                                               !8, !1
         27      > JMPNZ                                                    ~32, ->23
   45    28    >   SUB                                              ~33     !1, 1
         29        ASSIGN                                                   !8, ~33
         30        SUB                                              ~35     !3, 1
         31        ASSIGN_DIM                                               !5, ~35
         32        OP_DATA                                                  0
         33      > JMP                                                      ->46
   46    34    >   DIV                                              ~37     !8, !2
         35        DIV                                              ~39     !8, !2
         36        FETCH_DIM_R                                      ~40     !5, ~39
         37        SL                                               ~41     ~40, 8
         38        INIT_FCALL                                               'ord'
         39        FETCH_DIM_R                                      ~42     !0, !8
         40        SEND_VAL                                                 ~42
         41        DO_ICALL                                         $43     
         42        ADD                                              ~44     ~41, $43
         43        ASSIGN_DIM                                               !5, ~37
         44        OP_DATA                                                  ~44
   45    45        PRE_DEC                                                  !8
         46    >   IS_NOT_EQUAL                                             !8, -1
         47      > JMPNZ                                                    ~46, ->34
   48    48    >   FETCH_STATIC_PROP_W          unknown             $47     'S'
         49        ASSIGN_DIM                                               $47, 0
         50        OP_DATA                                                  !6
         51        ASSIGN                                                   !8, 1
         52      > JMP                                                      ->61
   49    53    >   SUB                                              ~53     !8, 1
         54        FETCH_STATIC_PROP_R          unknown             ~52     'S'
         55        FETCH_DIM_R                                      ~54     ~52, ~53
         56        ADD                                              ~55     ~54, !7
         57        FETCH_STATIC_PROP_W          unknown             $50     'S'
         58        ASSIGN_DIM                                               $50, !8
         59        OP_DATA                                                  ~55
   48    60        PRE_INC                                                  !8
         61    >   IS_SMALLER                                               !8, !4
         62      > JMPNZ                                                    ~57, ->53
   51    63    >   INIT_FCALL                                               'max'
         64        SEND_VAR                                                 !4
         65        SEND_VAR                                                 !3
         66        DO_ICALL                                         $58     
         67        ASSIGN                                                   !9, $58
   53    68        ASSIGN                                           ~60     !13, 0
         69        ASSIGN                                           ~61     !12, ~60
         70        ASSIGN                                           ~62     !8, ~61
         71        ASSIGN                                           ~63     !11, ~62
         72        ASSIGN                                                   !10, ~63
         73      > JMP                                                      ->111
   55    74    >   INIT_STATIC_METHOD_CALL                                  'ROTL'
         75        FETCH_STATIC_PROP_R          unknown             ~67     'S'
         76        FETCH_DIM_R                                      ~68     ~67, !8
         77        ADD                                              ~69     !10, !11
         78        ADD                                              ~70     ~68, ~69
         79        SEND_VAL                                                 ~70
         80        SEND_VAL                                                 3
         81        FETCH_STATIC_PROP_R          unknown             ~71     'w'
         82        SEND_VAL                                                 ~71
         83        DO_FCALL                                      0  $72     
         84        FETCH_STATIC_PROP_W          unknown             $65     'S'
         85        ASSIGN_DIM                                       ~66     $65, !8
         86        OP_DATA                                                  $72
         87        ASSIGN                                                   !10, ~66
   56    88        INIT_STATIC_METHOD_CALL                                  'ROTL'
         89        FETCH_DIM_R                                      ~75     !5, !12
         90        ADD                                              ~76     !10, !11
         91        ADD                                              ~77     ~75, ~76
         92        SEND_VAL                                                 ~77
         93        ADD                                              ~78     !10, !11
         94        FETCH_STATIC_PROP_R          unknown             ~79     'w'
         95        SUB                                              ~80     ~79, 1
         96        BW_AND                                           ~81     ~78, ~80
         97        SEND_VAL                                                 ~81
         98        FETCH_STATIC_PROP_R          unknown             ~82     'w'
         99        SEND_VAL                                                 ~82
        100        DO_FCALL                                      0  $83     
        101        ASSIGN_DIM                                       ~74     !5, !12
        102        OP_DATA                                                  $83
        103        ASSIGN                                                   !11, ~74
   53   104        PRE_INC                                                  !13
        105        ADD                                              ~86     !8, 1
        106        MOD                                              ~87     ~86, !4
        107        ASSIGN                                                   !8, ~87
        108        ADD                                              ~89     !12, 1
        109        MOD                                              ~90     ~89, !3
        110        ASSIGN                                                   !12, ~90
        111    >   MUL                                              ~92     !9, 3
        112        IS_SMALLER                                               !13, ~92
        113      > JMPNZ                                                    ~93, ->74
   59   114    > > RETURN                                                   null

End of function rc5_init

Function rc5_encrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 13
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 13
Branch analysis from position: 48
Branch analysis from position: 13
filename:       /in/CRKNZ
function name:  rc5_encrypt
number of ops:  66
compiled vars:  !0 = $pt, !1 = $A, !2 = $B, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   60     0  E >   RECV                                             !0      
   62     1        FETCH_DIM_R                                      ~4      !0, 0
          2        FETCH_STATIC_PROP_R          unknown             ~5      'S'
          3        FETCH_DIM_R                                      ~6      ~5, 0
          4        ADD                                              ~7      ~4, ~6
          5        ASSIGN                                                   !1, ~7
          6        FETCH_DIM_R                                      ~9      !0, 1
          7        FETCH_STATIC_PROP_R          unknown             ~10     'S'
          8        FETCH_DIM_R                                      ~11     ~10, 1
          9        ADD                                              ~12     ~9, ~11
         10        ASSIGN                                                   !2, ~12
   64    11        ASSIGN                                                   !3, 1
         12      > JMP                                                      ->45
   66    13    >   INIT_STATIC_METHOD_CALL                                  'ROTL'
         14        BW_XOR                                           ~15     !1, !2
         15        SEND_VAL                                                 ~15
         16        FETCH_STATIC_PROP_R          unknown             ~16     'w'
         17        SUB                                              ~17     ~16, 1
         18        BW_AND                                           ~18     !2, ~17
         19        SEND_VAL                                                 ~18
         20        FETCH_STATIC_PROP_R          unknown             ~19     'w'
         21        SEND_VAL                                                 ~19
         22        DO_FCALL                                      0  $20     
         23        MUL                                              ~22     !3, 2
         24        FETCH_STATIC_PROP_R          unknown             ~21     'S'
         25        FETCH_DIM_R                                      ~23     ~21, ~22
         26        ADD                                              ~24     $20, ~23
         27        ASSIGN                                                   !1, ~24
   67    28        INIT_STATIC_METHOD_CALL                                  'ROTL'
         29        BW_XOR                                           ~26     !2, !1
         30        SEND_VAL                                                 ~26
         31        FETCH_STATIC_PROP_R          unknown             ~27     'w'
         32        SUB                                              ~28     ~27, 1
         33        BW_AND                                           ~29     !1, ~28
         34        SEND_VAL                                                 ~29
         35        FETCH_STATIC_PROP_R          unknown             ~30     'w'
         36        SEND_VAL                                                 ~30
         37        DO_FCALL                                      0  $31     
         38        MUL                                              ~33     !3, 2
         39        ADD                                              ~34     ~33, 1
         40        FETCH_STATIC_PROP_R          unknown             ~32     'S'
         41        FETCH_DIM_R                                      ~35     ~32, ~34
         42        ADD                                              ~36     $31, ~35
         43        ASSIGN                                                   !2, ~36
   64    44        PRE_INC                                                  !3
         45    >   FETCH_STATIC_PROP_R          unknown             ~39     'r'
         46        IS_SMALLER_OR_EQUAL                                      !3, ~39
         47      > JMPNZ                                                    ~40, ->13
   69    48    >   INIT_FCALL                                               'pow'
         49        SEND_VAL                                                 2
         50        FETCH_STATIC_PROP_R          unknown             ~41     'w'
         51        SEND_VAL                                                 ~41
         52        DO_ICALL                                         $42     
         53        SUB                                              ~43     $42, 1
         54        BW_AND                                           ~44     !1, ~43
         55        INIT_ARRAY                                       ~45     ~44
         56        INIT_FCALL                                               'pow'
         57        SEND_VAL                                                 2
         58        FETCH_STATIC_PROP_R          unknown             ~46     'w'
         59        SEND_VAL                                                 ~46
         60        DO_ICALL                                         $47     
         61        SUB                                              ~48     $47, 1
         62        BW_AND                                           ~49     !2, ~48
         63        ADD_ARRAY_ELEMENT                                ~45     ~49
         64      > RETURN                                                   ~45
   70    65*     > RETURN                                                   null

End of function rc5_encrypt

Function rc5_decrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 8
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 8
Branch analysis from position: 42
Branch analysis from position: 8
filename:       /in/CRKNZ
function name:  rc5_decrypt
number of ops:  66
compiled vars:  !0 = $ct, !1 = $B, !2 = $A, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   72     0  E >   RECV                                             !0      
   74     1        FETCH_DIM_R                                      ~4      !0, 1
          2        ASSIGN                                                   !1, ~4
          3        FETCH_DIM_R                                      ~6      !0, 0
          4        ASSIGN                                                   !2, ~6
   76     5        FETCH_STATIC_PROP_R          unknown             ~8      'r'
          6        ASSIGN                                                   !3, ~8
          7      > JMP                                                      ->40
   78     8    >   INIT_STATIC_METHOD_CALL                                  'ROTR'
          9        MUL                                              ~11     !3, 2
         10        ADD                                              ~12     ~11, 1
         11        FETCH_STATIC_PROP_R          unknown             ~10     'S'
         12        FETCH_DIM_R                                      ~13     ~10, ~12
         13        SUB                                              ~14     !1, ~13
         14        SEND_VAL                                                 ~14
         15        FETCH_STATIC_PROP_R          unknown             ~15     'w'
         16        SUB                                              ~16     ~15, 1
         17        BW_AND                                           ~17     !2, ~16
         18        SEND_VAL                                                 ~17
         19        FETCH_STATIC_PROP_R          unknown             ~18     'w'
         20        SEND_VAL                                                 ~18
         21        DO_FCALL                                      0  $19     
         22        BW_XOR                                           ~20     !2, $19
         23        ASSIGN                                                   !1, ~20
   79    24        INIT_STATIC_METHOD_CALL                                  'ROTR'
         25        MUL                                              ~23     !3, 2
         26        FETCH_STATIC_PROP_R          unknown             ~22     'S'
         27        FETCH_DIM_R                                      ~24     ~22, ~23
         28        SUB                                              ~25     !2, ~24
         29        SEND_VAL                                                 ~25
         30        FETCH_STATIC_PROP_R          unknown             ~26     'w'
         31        SUB                                              ~27     ~26, 1
         32        BW_AND                                           ~28     !1, ~27
         33        SEND_VAL                                                 ~28
         34        FETCH_STATIC_PROP_R          unknown             ~29     'w'
         35        SEND_VAL                                                 ~29
         36        DO_FCALL                                      0  $30     
         37        BW_XOR                                           ~31     !1, $30
         38        ASSIGN                                                   !2, ~31
   76    39        PRE_DEC                                                  !3
         40    >   IS_SMALLER                                               0, !3
         41      > JMPNZ                                                    ~34, ->8
   82    42    >   FETCH_STATIC_PROP_R          unknown             ~35     'S'
         43        FETCH_DIM_R                                      ~36     ~35, 0
         44        SUB                                              ~37     !2, ~36
         45        INIT_FCALL                                               'pow'
         46        SEND_VAL                                                 2
         47        FETCH_STATIC_PROP_R          unknown             ~38     'w'
         48        SEND_VAL                                                 ~38
         49        DO_ICALL                                         $39     
         50        SUB                                              ~40     $39, 1
         51        BW_AND                                           ~41     ~37, ~40
         52        INIT_ARRAY                                       ~42     ~41
         53        FETCH_STATIC_PROP_R          unknown             ~43     'S'
         54        FETCH_DIM_R                                      ~44     ~43, 1
         55        SUB                                              ~45     !1, ~44
         56        INIT_FCALL                                               'pow'
         57        SEND_VAL                                                 2
         58        FETCH_STATIC_PROP_R          unknown             ~46     'w'
         59        SEND_VAL                                                 ~46
         60        DO_ICALL                                         $47     
         61        SUB                                              ~48     $47, 1
         62  

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.36 ms | 1428 KiB | 37 Q