corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 : HELLO ( -- ) CR ." Hello, world!" ;
2  
3 HELLO <cr>
4 Hello, world!
5  
6 : [CHAR] CHAR POSTPONE LITERAL ; IMMEDIATE
7  
8  
9  
10 create SArray 256 allot \ state array of 256 bytes
11 : KeyArray KeyLen mod KeyAddr ;
12  
13 : get_byte + c@ ;
14 : set_byte + c! ;
15 : as_byte 255 and ;
16 : reset_ij 0 TO ii 0 TO jj ;
17 : i_update 1 + as_byte TO ii ;
18 : j_update ii SArray get_byte + as_byte TO jj ;
19 : swap_s_ij
20 jj SArray get_byte
21 ii SArray get_byte jj SArray set_byte
22 ii SArray set_byte
23 ;
24  
25 : rc4_init ( KeyAddr KeyLen -- )
26 256 min TO KeyLen TO KeyAddr
27 256 0 DO i i SArray set_byte LOOP
28 reset_ij
29 BEGIN
30 ii KeyArray get_byte jj + j_update
31 swap_s_ij
32 ii 255 < WHILE
33 ii i_update
34 REPEAT
35 reset_ij
36 ;
37 : rc4_byte
38 ii i_update jj j_update
39 swap_s_ij
40 ii SArray get_byte jj SArray get_byte + as_byte SArray get_byte xor
41 ;