clear
key         = oem_strset( 32, 00, 01 )
count       = 01
nonce       = 00 00 00 00 00 00 00 4a 00 00 00 00
kk          = ""
kk          = $kk 4c 61 64 69 65 73 20 61 6e 64 20 47 65 6e 74 6c
kk          = $kk 65 6d 65 6e 20 6f 66 20 74 68 65 20 63 6c 61 73
kk          = $kk 73 20 6f 66 20 27 39 39 3a 20 49 66 20 49 20 63
kk          = $kk 6f 75 6c 64 20 6f 66 66 65 72 20 79 6f 75 20 6f
kk          = $kk 6e 6c 79 20 6f 6e 65 20 74 69 70 20 66 6f 72 20
kk          = $kk 74 68 65 20 66 75 74 75 72 65 2c 20 73 75 6e 73
kk          = $kk 63 72 65 65 6e 20 77 6f 75 6c 64 20 62 65 20 69
kk          = $kk 74 2e

ciphertext  = chacha20( $kk, $key, $count, $nonce )

if $ciphertext != 6e 2e 35 9a 25 68 f9 80 41 ba 07 28 dd 0d 69 81 e9 7e 7a ec 1d 43 60 c2 0a 27 af cc fd 9f ae 0b f9 1b 65 c5 52 47 33 ab 8f 59 3d ab cd 62 b3 57 16 39 d6 24 e6 51 52 ab 8f 53 0c 35 9f 08 61 d8 07 ca 0d bf 50 0d 6a 61 56 a3 8e 08 8a 22 b6 5e 52 bc 51 4d 16 cc f8 06 81 8c e9 1a b7 79 37 36 5a f9 0b bf 74 a3 5b e6 b4 0b 8e ed f2 78 5e 42 87 4d
    
?
    
pause
endif
ciphertext  = chacha20( $ciphertext, $key, $count, $nonce )
if $ciphertext != $kk
    
?
    
pause
endif

end

key         = 0000000000000000000000000000000000000000000000000000000000000000
count       = 00
plain       = dup( 64, 00 )

ciphertext  = chacha20( $plain, $key, $count, 000000000000000000000002 )

key         = 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
count       = 02
plain       = dup( 64, 00 )

ciphertext  = chacha20( $plain, $key, $count, 000000000000000000000000 )

key         = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
count       = 00
plain       = dup( 64, 00 )

ciphertext  = chacha20( $plain, $key, $count, 000000000000000000000002 )

end


key         = oem_strset( 16, 00, 01 )
count       = 01
nonce       = 00 00 00 00 00 00 00 4a 00 00 00 00
plain       = "Ladies and Gentlemen of the class of ’99: If I could offer you only one tip forthe future, sunscreen would be it."
ciphertext  = chacha20( $plain, $key, $count, $nonce )

kk          = ""
kk          = $kk 4c 61 64 69 65 73 20 61 6e 64 20 47 65 6e 74 6c
kk          = $kk 65 6d 65 6e 20 6f 66 20 74 68 65 20 63 6c 61 73
kk          = $kk 73 20 6f 66 20 27 39 39 3a 20 49 66 20 49 20 63
kk          = $kk 6f 75 6c 64 20 6f 66 66 65 72 20 79 6f 75 20 6f
kk          = $kk 6e 6c 79 20 6f 6e 65 20 74 69 70 20 66 6f 72 20
kk          = $kk 74 68 65 20 66 75 74 75 72 65 2c 20 73 75 6e 73
kk          = $kk 63 72 65 65 6e 20 77 6f 75 6c 64 20 62 65 20 69
kk          = $kk 74 2e

ciphertext  = chacha20( $kk, $key, $count, $nonce )