I have made some test.
This is good speed improvement.
- For each process execute more work if possible and after finish wait for other work to do without respawn.
Code: Select all
@echo off & setlocal EnableDelayedExpansion
set i=100
set t0=%time%
:loop
set /a RC[1]=0x01 & set /a RC[2]=0x02 & set /a RC[3]=0x04 & set /a RC[4]=0x08 & set /a RC[5]=0x10
set /a RC[6]=0x20 & set /a RC[7]=0x40 & set /a RC[8]=0x80 & set /a RC[9]=0x1b & set /a RC[10]=0x36
:: Define pre-computed Rijndael S-box values for SubBytes() function and key scheduler algorithm
set /a S[0]=0x63 & set /a S[1]=0x7c & set /a S[2]=0x77 & set /a S[3]=0x7b & set /a S[4]=0xf2
set /a S[5]=0x6b & set /a S[6]=0x6f & set /a S[7]=0xc5 & set /a S[8]=0x30 & set /a S[9]=0x01
set /a S[10]=0x67 & set /a S[11]=0x2b & set /a S[12]=0xfe & set /a S[13]=0xd7 & set /a S[14]=0xab
set /a S[15]=0x76 & set /a S[16]=0xca & set /a S[17]=0x82 & set /a S[18]=0xc9 & set /a S[19]=0x7d
set /a S[20]=0xfa & set /a S[21]=0x59 & set /a S[22]=0x47 & set /a S[23]=0xf0 & set /a S[24]=0xad
set /a S[25]=0xd4 & set /a S[26]=0xa2 & set /a S[27]=0xaf & set /a S[28]=0x9c & set /a S[29]=0xa4
set /a S[30]=0x72 & set /a S[31]=0xc0 & set /a S[32]=0xb7 & set /a S[33]=0xfd & set /a S[34]=0x93
set /a S[35]=0x26 & set /a S[36]=0x36 & set /a S[37]=0x3f & set /a S[38]=0xf7 & set /a S[39]=0xcc
set /a S[40]=0x34 & set /a S[41]=0xa5 & set /a S[42]=0xe5 & set /a S[43]=0xf1 & set /a S[44]=0x71
set /a S[45]=0xd8 & set /a S[46]=0x31 & set /a S[47]=0x15 & set /a S[48]=0x04 & set /a S[49]=0xc7
set /a S[50]=0x23 & set /a S[51]=0xc3 & set /a S[52]=0x18 & set /a S[53]=0x96 & set /a S[54]=0x05
set /a S[55]=0x9a & set /a S[56]=0x07 & set /a S[57]=0x12 & set /a S[58]=0x80 & set /a S[59]=0xe2
set /a S[60]=0xeb & set /a S[61]=0x27 & set /a S[62]=0xb2 & set /a S[63]=0x75 & set /a S[64]=0x09
set /a S[65]=0x83 & set /a S[66]=0x2c & set /a S[67]=0x1a & set /a S[68]=0x1b & set /a S[69]=0x6e
set /a S[70]=0x5a & set /a S[71]=0xa0 & set /a S[72]=0x52 & set /a S[73]=0x3b & set /a S[74]=0xd6
set /a S[75]=0xb3 & set /a S[76]=0x29 & set /a S[77]=0xe3 & set /a S[78]=0x2f & set /a S[79]=0x84
set /a S[80]=0x53 & set /a S[81]=0xd1 & set /a S[82]=0x00 & set /a S[83]=0xed & set /a S[84]=0x20
set /a S[85]=0xfc & set /a S[86]=0xb1 & set /a S[87]=0x5b & set /a S[88]=0x6a & set /a S[89]=0xcb
set /a S[90]=0xbe & set /a S[91]=0x39 & set /a S[92]=0x4a & set /a S[93]=0x4c & set /a S[94]=0x58
set /a S[95]=0xcf & set /a S[96]=0xd0 & set /a S[97]=0xef & set /a S[98]=0xaa & set /a S[99]=0xfb
set /a i=i-1
if !i! gtr 0 goto :loop
set t1=%time%
for /F "tokens=1-8 delims=:.," %%a in ("!t0: =0!:!t1: =0!") do set /a "a=(((1%%e-1%%a)*60)+1%%f-1%%b)*6000+1%%g%%h-1%%c%%d, a+=(a>>31) & 8640000"
echo Execution time: %a%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set i=100
set t0=%time%
:loop1
call aes_set_1.cmd
set /a i=i-1
if !i! gtr 0 goto :loop1
set t1=%time%
for /F "tokens=1-8 delims=:.," %%a in ("!t0: =0!:!t1: =0!") do set /a "a=(((1%%e-1%%a)*60)+1%%f-1%%b)*6000+1%%g%%h-1%%c%%d, a+=(a>>31) & 8640000"
echo Execution time: %a%
goto :next_test
rem aes_set_1.cmd:
set /a RC[1]=0x01 & set /a RC[2]=0x02 & set /a RC[3]=0x04 & set /a RC[4]=0x08 & set /a RC[5]=0x10
set /a RC[6]=0x20 & set /a RC[7]=0x40 & set /a RC[8]=0x80 & set /a RC[9]=0x1b & set /a RC[10]=0x36
:: Define pre-computed Rijndael S-box values for SubBytes() function and key scheduler algorithm
set /a S[0]=0x63 & set /a S[1]=0x7c & set /a S[2]=0x77 & set /a S[3]=0x7b & set /a S[4]=0xf2
set /a S[5]=0x6b & set /a S[6]=0x6f & set /a S[7]=0xc5 & set /a S[8]=0x30 & set /a S[9]=0x01
set /a S[10]=0x67 & set /a S[11]=0x2b & set /a S[12]=0xfe & set /a S[13]=0xd7 & set /a S[14]=0xab
set /a S[15]=0x76 & set /a S[16]=0xca & set /a S[17]=0x82 & set /a S[18]=0xc9 & set /a S[19]=0x7d
set /a S[20]=0xfa & set /a S[21]=0x59 & set /a S[22]=0x47 & set /a S[23]=0xf0 & set /a S[24]=0xad
set /a S[25]=0xd4 & set /a S[26]=0xa2 & set /a S[27]=0xaf & set /a S[28]=0x9c & set /a S[29]=0xa4
set /a S[30]=0x72 & set /a S[31]=0xc0 & set /a S[32]=0xb7 & set /a S[33]=0xfd & set /a S[34]=0x93
set /a S[35]=0x26 & set /a S[36]=0x36 & set /a S[37]=0x3f & set /a S[38]=0xf7 & set /a S[39]=0xcc
set /a S[40]=0x34 & set /a S[41]=0xa5 & set /a S[42]=0xe5 & set /a S[43]=0xf1 & set /a S[44]=0x71
set /a S[45]=0xd8 & set /a S[46]=0x31 & set /a S[47]=0x15 & set /a S[48]=0x04 & set /a S[49]=0xc7
set /a S[50]=0x23 & set /a S[51]=0xc3 & set /a S[52]=0x18 & set /a S[53]=0x96 & set /a S[54]=0x05
set /a S[55]=0x9a & set /a S[56]=0x07 & set /a S[57]=0x12 & set /a S[58]=0x80 & set /a S[59]=0xe2
set /a S[60]=0xeb & set /a S[61]=0x27 & set /a S[62]=0xb2 & set /a S[63]=0x75 & set /a S[64]=0x09
set /a S[65]=0x83 & set /a S[66]=0x2c & set /a S[67]=0x1a & set /a S[68]=0x1b & set /a S[69]=0x6e
set /a S[70]=0x5a & set /a S[71]=0xa0 & set /a S[72]=0x52 & set /a S[73]=0x3b & set /a S[74]=0xd6
set /a S[75]=0xb3 & set /a S[76]=0x29 & set /a S[77]=0xe3 & set /a S[78]=0x2f & set /a S[79]=0x84
set /a S[80]=0x53 & set /a S[81]=0xd1 & set /a S[82]=0x00 & set /a S[83]=0xed & set /a S[84]=0x20
set /a S[85]=0xfc & set /a S[86]=0xb1 & set /a S[87]=0x5b & set /a S[88]=0x6a & set /a S[89]=0xcb
set /a S[90]=0xbe & set /a S[91]=0x39 & set /a S[92]=0x4a & set /a S[93]=0x4c & set /a S[94]=0x58
set /a S[95]=0xcf & set /a S[96]=0xd0 & set /a S[97]=0xef & set /a S[98]=0xaa & set /a S[99]=0xfb
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:next_test
set t0=%time%
For /L %%i in (1,1,100) do (
call aes_set_1.cmd
)
set t1=%time%
for /F "tokens=1-8 delims=:.," %%a in ("!t0: =0!:!t1: =0!") do set /a "a=(((1%%e-1%%a)*60)+1%%f-1%%b)*6000+1%%g%%h-1%%c%%d, a+=(a>>31) & 8640000"
echo Execution time: %a%
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set i=100
set t0=%time%
:loop2
(
set /a RC[1]=0x01 & set /a RC[2]=0x02 & set /a RC[3]=0x04 & set /a RC[4]=0x08 & set /a RC[5]=0x10
set /a RC[6]=0x20 & set /a RC[7]=0x40 & set /a RC[8]=0x80 & set /a RC[9]=0x1b & set /a RC[10]=0x36
:: Define pre-computed Rijndael S-box values for SubBytes() function and key scheduler algorithm
set /a S[0]=0x63 & set /a S[1]=0x7c & set /a S[2]=0x77 & set /a S[3]=0x7b & set /a S[4]=0xf2
set /a S[5]=0x6b & set /a S[6]=0x6f & set /a S[7]=0xc5 & set /a S[8]=0x30 & set /a S[9]=0x01
set /a S[10]=0x67 & set /a S[11]=0x2b & set /a S[12]=0xfe & set /a S[13]=0xd7 & set /a S[14]=0xab
set /a S[15]=0x76 & set /a S[16]=0xca & set /a S[17]=0x82 & set /a S[18]=0xc9 & set /a S[19]=0x7d
set /a S[20]=0xfa & set /a S[21]=0x59 & set /a S[22]=0x47 & set /a S[23]=0xf0 & set /a S[24]=0xad
set /a S[25]=0xd4 & set /a S[26]=0xa2 & set /a S[27]=0xaf & set /a S[28]=0x9c & set /a S[29]=0xa4
set /a S[30]=0x72 & set /a S[31]=0xc0 & set /a S[32]=0xb7 & set /a S[33]=0xfd & set /a S[34]=0x93
set /a S[35]=0x26 & set /a S[36]=0x36 & set /a S[37]=0x3f & set /a S[38]=0xf7 & set /a S[39]=0xcc
set /a S[40]=0x34 & set /a S[41]=0xa5 & set /a S[42]=0xe5 & set /a S[43]=0xf1 & set /a S[44]=0x71
set /a S[45]=0xd8 & set /a S[46]=0x31 & set /a S[47]=0x15 & set /a S[48]=0x04 & set /a S[49]=0xc7
set /a S[50]=0x23 & set /a S[51]=0xc3 & set /a S[52]=0x18 & set /a S[53]=0x96 & set /a S[54]=0x05
set /a S[55]=0x9a & set /a S[56]=0x07 & set /a S[57]=0x12 & set /a S[58]=0x80 & set /a S[59]=0xe2
set /a S[60]=0xeb & set /a S[61]=0x27 & set /a S[62]=0xb2 & set /a S[63]=0x75 & set /a S[64]=0x09
set /a S[65]=0x83 & set /a S[66]=0x2c & set /a S[67]=0x1a & set /a S[68]=0x1b & set /a S[69]=0x6e
set /a S[70]=0x5a & set /a S[71]=0xa0 & set /a S[72]=0x52 & set /a S[73]=0x3b & set /a S[74]=0xd6
set /a S[75]=0xb3 & set /a S[76]=0x29 & set /a S[77]=0xe3 & set /a S[78]=0x2f & set /a S[79]=0x84
set /a S[80]=0x53 & set /a S[81]=0xd1 & set /a S[82]=0x00 & set /a S[83]=0xed & set /a S[84]=0x20
set /a S[85]=0xfc & set /a S[86]=0xb1 & set /a S[87]=0x5b & set /a S[88]=0x6a & set /a S[89]=0xcb
set /a S[90]=0xbe & set /a S[91]=0x39 & set /a S[92]=0x4a & set /a S[93]=0x4c & set /a S[94]=0x58
set /a S[95]=0xcf & set /a S[96]=0xd0 & set /a S[97]=0xef & set /a S[98]=0xaa & set /a S[99]=0xfb
)
set /a i=i-1
if !i! gtr 0 goto :loop2
set t1=%time%
for /F "tokens=1-8 delims=:.," %%a in ("!t0: =0!:!t1: =0!") do set /a "a=(((1%%e-1%%a)*60)+1%%f-1%%b)*6000+1%%g%%h-1%%c%%d, a+=(a>>31) & 8640000"
echo Execution time: %a%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set t0=%time%
For /L %%i in (1,1,100) do (
set /a RC[1]=0x01 & set /a RC[2]=0x02 & set /a RC[3]=0x04 & set /a RC[4]=0x08 & set /a RC[5]=0x10
set /a RC[6]=0x20 & set /a RC[7]=0x40 & set /a RC[8]=0x80 & set /a RC[9]=0x1b & set /a RC[10]=0x36
:: Define pre-computed Rijndael S-box values for SubBytes() function and key scheduler algorithm
set /a S[0]=0x63 & set /a S[1]=0x7c & set /a S[2]=0x77 & set /a S[3]=0x7b & set /a S[4]=0xf2
set /a S[5]=0x6b & set /a S[6]=0x6f & set /a S[7]=0xc5 & set /a S[8]=0x30 & set /a S[9]=0x01
set /a S[10]=0x67 & set /a S[11]=0x2b & set /a S[12]=0xfe & set /a S[13]=0xd7 & set /a S[14]=0xab
set /a S[15]=0x76 & set /a S[16]=0xca & set /a S[17]=0x82 & set /a S[18]=0xc9 & set /a S[19]=0x7d
set /a S[20]=0xfa & set /a S[21]=0x59 & set /a S[22]=0x47 & set /a S[23]=0xf0 & set /a S[24]=0xad
set /a S[25]=0xd4 & set /a S[26]=0xa2 & set /a S[27]=0xaf & set /a S[28]=0x9c & set /a S[29]=0xa4
set /a S[30]=0x72 & set /a S[31]=0xc0 & set /a S[32]=0xb7 & set /a S[33]=0xfd & set /a S[34]=0x93
set /a S[35]=0x26 & set /a S[36]=0x36 & set /a S[37]=0x3f & set /a S[38]=0xf7 & set /a S[39]=0xcc
set /a S[40]=0x34 & set /a S[41]=0xa5 & set /a S[42]=0xe5 & set /a S[43]=0xf1 & set /a S[44]=0x71
set /a S[45]=0xd8 & set /a S[46]=0x31 & set /a S[47]=0x15 & set /a S[48]=0x04 & set /a S[49]=0xc7
set /a S[50]=0x23 & set /a S[51]=0xc3 & set /a S[52]=0x18 & set /a S[53]=0x96 & set /a S[54]=0x05
set /a S[55]=0x9a & set /a S[56]=0x07 & set /a S[57]=0x12 & set /a S[58]=0x80 & set /a S[59]=0xe2
set /a S[60]=0xeb & set /a S[61]=0x27 & set /a S[62]=0xb2 & set /a S[63]=0x75 & set /a S[64]=0x09
set /a S[65]=0x83 & set /a S[66]=0x2c & set /a S[67]=0x1a & set /a S[68]=0x1b & set /a S[69]=0x6e
set /a S[70]=0x5a & set /a S[71]=0xa0 & set /a S[72]=0x52 & set /a S[73]=0x3b & set /a S[74]=0xd6
set /a S[75]=0xb3 & set /a S[76]=0x29 & set /a S[77]=0xe3 & set /a S[78]=0x2f & set /a S[79]=0x84
set /a S[80]=0x53 & set /a S[81]=0xd1 & set /a S[82]=0x00 & set /a S[83]=0xed & set /a S[84]=0x20
set /a S[85]=0xfc & set /a S[86]=0xb1 & set /a S[87]=0x5b & set /a S[88]=0x6a & set /a S[89]=0xcb
set /a S[90]=0xbe & set /a S[91]=0x39 & set /a S[92]=0x4a & set /a S[93]=0x4c & set /a S[94]=0x58
set /a S[95]=0xcf & set /a S[96]=0xd0 & set /a S[97]=0xef & set /a S[98]=0xaa & set /a S[99]=0xfb
)
set t1=%time%
for /F "tokens=1-8 delims=:.," %%a in ("!t0: =0!:!t1: =0!") do set /a "a=(((1%%e-1%%a)*60)+1%%f-1%%b)*6000+1%%g%%h-1%%c%%d, a+=(a>>31) & 8640000"
echo Execution time: %a%
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set t0=%time%
For /L %%i in (1,1,100) do (
set /a RC[1]=0x01, RC[2]=0x02, RC[3]=0x04, RC[4]=0x08, RC[5]=0x10
set /a RC[6]=0x20, RC[7]=0x40, RC[8]=0x80, RC[9]=0x1b, RC[10]=0x36
:: Define pre-computed Rijndael S-box values for SubBytes() function and key scheduler algorithm
set /a S[0]=0x63, S[1]=0x7c, S[2]=0x77, S[3]=0x7b, S[4]=0xf2
set /a S[5]=0x6b, S[6]=0x6f, S[7]=0xc5, S[8]=0x30, S[9]=0x01
set /a S[10]=0x67, S[11]=0x2b, S[12]=0xfe, S[13]=0xd7, S[14]=0xab
set /a S[15]=0x76, S[16]=0xca, S[17]=0x82, S[18]=0xc9, S[19]=0x7d
set /a S[20]=0xfa, S[21]=0x59, S[22]=0x47, S[23]=0xf0, S[24]=0xad
set /a S[25]=0xd4, S[26]=0xa2, S[27]=0xaf, S[28]=0x9c, S[29]=0xa4
set /a S[30]=0x72, S[31]=0xc0, S[32]=0xb7, S[33]=0xfd, S[34]=0x93
set /a S[35]=0x26, S[36]=0x36, S[37]=0x3f, S[38]=0xf7, S[39]=0xcc
set /a S[40]=0x34, S[41]=0xa5, S[42]=0xe5, S[43]=0xf1, S[44]=0x71
set /a S[45]=0xd8, S[46]=0x31, S[47]=0x15, S[48]=0x04, S[49]=0xc7
set /a S[50]=0x23, S[51]=0xc3, S[52]=0x18, S[53]=0x96, S[54]=0x05
set /a S[55]=0x9a, S[56]=0x07, S[57]=0x12, S[58]=0x80, S[59]=0xe2
set /a S[60]=0xeb, S[61]=0x27, S[62]=0xb2, S[63]=0x75, S[64]=0x09
set /a S[65]=0x83, S[66]=0x2c, S[67]=0x1a, S[68]=0x1b, S[69]=0x6e
set /a S[70]=0x5a, S[71]=0xa0, S[72]=0x52, S[73]=0x3b, S[74]=0xd6
set /a S[75]=0xb3, S[76]=0x29, S[77]=0xe3, S[78]=0x2f, S[79]=0x84
set /a S[80]=0x53, S[81]=0xd1, S[82]=0x00, S[83]=0xed, S[84]=0x20
set /a S[85]=0xfc, S[86]=0xb1, S[87]=0x5b, S[88]=0x6a, S[89]=0xcb
set /a S[90]=0xbe, S[91]=0x39, S[92]=0x4a, S[93]=0x4c, S[94]=0x58
set /a S[95]=0xcf, S[96]=0xd0, S[97]=0xef, S[98]=0xaa, S[99]=0xfb
)
set t1=%time%
for /F "tokens=1-8 delims=:.," %%a in ("!t0: =0!:!t1: =0!") do set /a "a=(((1%%e-1%%a)*60)+1%%f-1%%b)*6000+1%%g%%h-1%%c%%d, a+=(a>>31) & 8640000"
echo Execution time: %a%
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set t0=%time%
For /L %%i in (1,1,100) do (
set /a RC[1]=0x01, RC[2]=0x02, RC[3]=0x04, RC[4]=0x08, RC[5]=0x10, RC[6]=0x20, RC[7]=0x40, RC[8]=0x80, RC[9]=0x1b, RC[10]=0x36
:: Define pre-computed Rijndael S-box values for SubBytes() function and key scheduler algorithm
set /a S[0]=0x63, S[1]=0x7c, S[2]=0x77, S[3]=0x7b, S[4]=0xf2, S[5]=0x6b, S[6]=0x6f, S[7]=0xc5, S[8]=0x30, S[9]=0x01
set /a S[10]=0x67, S[11]=0x2b, S[12]=0xfe, S[13]=0xd7, S[14]=0xab, S[15]=0x76, S[16]=0xca, S[17]=0x82, S[18]=0xc9, S[19]=0x7d
set /a S[20]=0xfa, S[21]=0x59, S[22]=0x47, S[23]=0xf0, S[24]=0xad, S[25]=0xd4, S[26]=0xa2, S[27]=0xaf, S[28]=0x9c, S[29]=0xa4
set /a S[30]=0x72, S[31]=0xc0, S[32]=0xb7, S[33]=0xfd, S[34]=0x93, S[35]=0x26, S[36]=0x36, S[37]=0x3f, S[38]=0xf7, S[39]=0xcc
set /a S[40]=0x34, S[41]=0xa5, S[42]=0xe5, S[43]=0xf1, S[44]=0x71, S[45]=0xd8, S[46]=0x31, S[47]=0x15, S[48]=0x04, S[49]=0xc7
set /a S[50]=0x23, S[51]=0xc3, S[52]=0x18, S[53]=0x96, S[54]=0x05, S[55]=0x9a, S[56]=0x07, S[57]=0x12, S[58]=0x80, S[59]=0xe2
set /a S[60]=0xeb, S[61]=0x27, S[62]=0xb2, S[63]=0x75, S[64]=0x09, S[65]=0x83, S[66]=0x2c, S[67]=0x1a, S[68]=0x1b, S[69]=0x6e
set /a S[70]=0x5a, S[71]=0xa0, S[72]=0x52, S[73]=0x3b, S[74]=0xd6, S[75]=0xb3, S[76]=0x29, S[77]=0xe3, S[78]=0x2f, S[79]=0x84
set /a S[80]=0x53, S[81]=0xd1, S[82]=0x00, S[83]=0xed, S[84]=0x20, S[85]=0xfc, S[86]=0xb1, S[87]=0x5b, S[88]=0x6a, S[89]=0xcb
set /a S[90]=0xbe, S[91]=0x39, S[92]=0x4a, S[93]=0x4c, S[94]=0x58, S[95]=0xcf, S[96]=0xd0, S[97]=0xef, S[98]=0xaa, S[99]=0xfb
)
set t1=%time%
for /F "tokens=1-8 delims=:.," %%a in ("!t0: =0!:!t1: =0!") do set /a "a=(((1%%e-1%%a)*60)+1%%f-1%%b)*6000+1%%g%%h-1%%c%%d, a+=(a>>31) & 8640000"
echo Execution time: %a%
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
rem test no spawn ambient
for /f "delims==" %%f in ('set s[') do set %%f=
echo main thread: echo S[50]:!S[50]!
set t0=%time%
For /L %%i in (1,1,10) do (start /B /WAIT cmd /c AEScore_set_part.bat)
set t1=%time%
for /F "tokens=1-8 delims=:.," %%a in ("!t0: =0!:!t1: =0!") do set /a "a=(((1%%e-1%%a)*60)+1%%f-1%%b)*6000+1%%g%%h-1%%c%%d, a+=(a>>31) & 8640000"
echo Ambient recreation: Execution time: %a%
goto :next_test1
rem AEScore_set_part.bat:
@echo off & setlocal EnableDelayedExpansion
For /L %%j in (1,1,100) do (
set /a RC[1]=0x01, RC[2]=0x02, RC[3]=0x04, RC[4]=0x08, RC[5]=0x10, RC[6]=0x20, RC[7]=0x40, RC[8]=0x80, RC[9]=0x1b, RC[10]=0x36
:: Define pre-computed Rijndael S-box values for SubBytes() function and key scheduler algorithm
set /a S[0]=0x63, S[1]=0x7c, S[2]=0x77, S[3]=0x7b, S[4]=0xf2, S[5]=0x6b, S[6]=0x6f, S[7]=0xc5, S[8]=0x30, S[9]=0x01
set /a S[10]=0x67, S[11]=0x2b, S[12]=0xfe, S[13]=0xd7, S[14]=0xab, S[15]=0x76, S[16]=0xca, S[17]=0x82, S[18]=0xc9, S[19]=0x7d
set /a S[20]=0xfa, S[21]=0x59, S[22]=0x47, S[23]=0xf0, S[24]=0xad, S[25]=0xd4, S[26]=0xa2, S[27]=0xaf, S[28]=0x9c, S[29]=0xa4
set /a S[30]=0x72, S[31]=0xc0, S[32]=0xb7, S[33]=0xfd, S[34]=0x93, S[35]=0x26, S[36]=0x36, S[37]=0x3f, S[38]=0xf7, S[39]=0xcc
set /a S[40]=0x34, S[41]=0xa5, S[42]=0xe5, S[43]=0xf1, S[44]=0x71, S[45]=0xd8, S[46]=0x31, S[47]=0x15, S[48]=0x04, S[49]=0xc7
set /a S[50]=0x23, S[51]=0xc3, S[52]=0x18, S[53]=0x96, S[54]=0x05, S[55]=0x9a, S[56]=0x07, S[57]=0x12, S[58]=0x80, S[59]=0xe2
set /a S[60]=0xeb, S[61]=0x27, S[62]=0xb2, S[63]=0x75, S[64]=0x09, S[65]=0x83, S[66]=0x2c, S[67]=0x1a, S[68]=0x1b, S[69]=0x6e
set /a S[70]=0x5a, S[71]=0xa0, S[72]=0x52, S[73]=0x3b, S[74]=0xd6, S[75]=0xb3, S[76]=0x29, S[77]=0xe3, S[78]=0x2f, S[79]=0x84
set /a S[80]=0x53, S[81]=0xd1, S[82]=0x00, S[83]=0xed, S[84]=0x20, S[85]=0xfc, S[86]=0xb1, S[87]=0x5b, S[88]=0x6a, S[89]=0xcb
set /a S[90]=0xbe, S[91]=0x39, S[92]=0x4a, S[93]=0x4c, S[94]=0x58, S[95]=0xcf, S[96]=0xd0, S[97]=0xef, S[98]=0xaa, S[99]=0xfb
)
rem use of array
set lectures=10000
For /L %%j in (1,1,%lectures%) do ( echo !S[50]! > nul )
set /a "r=(%random% * %random%) %% 10"
if !r! lss 2 echo !r! child s[50]:!S[50]!
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:next_test1
rem test spawn ambient
set t0=%time%
(
set /a RC[1]=0x01, RC[2]=0x02, RC[3]=0x04, RC[4]=0x08, RC[5]=0x10, RC[6]=0x20, RC[7]=0x40, RC[8]=0x80, RC[9]=0x1b, RC[10]=0x36
:: Define pre-computed Rijndael S-box values for SubBytes() function and key scheduler algorithm
set /a S[0]=0x63, S[1]=0x7c, S[2]=0x77, S[3]=0x7b, S[4]=0xf2, S[5]=0x6b, S[6]=0x6f, S[7]=0xc5, S[8]=0x30, S[9]=0x01
set /a S[10]=0x67, S[11]=0x2b, S[12]=0xfe, S[13]=0xd7, S[14]=0xab, S[15]=0x76, S[16]=0xca, S[17]=0x82, S[18]=0xc9, S[19]=0x7d
set /a S[20]=0xfa, S[21]=0x59, S[22]=0x47, S[23]=0xf0, S[24]=0xad, S[25]=0xd4, S[26]=0xa2, S[27]=0xaf, S[28]=0x9c, S[29]=0xa4
set /a S[30]=0x72, S[31]=0xc0, S[32]=0xb7, S[33]=0xfd, S[34]=0x93, S[35]=0x26, S[36]=0x36, S[37]=0x3f, S[38]=0xf7, S[39]=0xcc
set /a S[40]=0x34, S[41]=0xa5, S[42]=0xe5, S[43]=0xf1, S[44]=0x71, S[45]=0xd8, S[46]=0x31, S[47]=0x15, S[48]=0x04, S[49]=0xc7
set /a S[50]=0x23, S[51]=0xc3, S[52]=0x18, S[53]=0x96, S[54]=0x05, S[55]=0x9a, S[56]=0x07, S[57]=0x12, S[58]=0x80, S[59]=0xe2
set /a S[60]=0xeb, S[61]=0x27, S[62]=0xb2, S[63]=0x75, S[64]=0x09, S[65]=0x83, S[66]=0x2c, S[67]=0x1a, S[68]=0x1b, S[69]=0x6e
set /a S[70]=0x5a, S[71]=0xa0, S[72]=0x52, S[73]=0x3b, S[74]=0xd6, S[75]=0xb3, S[76]=0x29, S[77]=0xe3, S[78]=0x2f, S[79]=0x84
set /a S[80]=0x53, S[81]=0xd1, S[82]=0x00, S[83]=0xed, S[84]=0x20, S[85]=0xfc, S[86]=0xb1, S[87]=0x5b, S[88]=0x6a, S[89]=0xcb
set /a S[90]=0xbe, S[91]=0x39, S[92]=0x4a, S[93]=0x4c, S[94]=0x58, S[95]=0xcf, S[96]=0xd0, S[97]=0xef, S[98]=0xaa, S[99]=0xfb
)
echo main thread: echo S[50]:!S[50]!
For /L %%i in (1,1,10) do (start /B /WAIT cmd /c AEScore_set_part_noset.bat)
set t1=%time%
for /F "tokens=1-8 delims=:.," %%a in ("!t0: =0!:!t1: =0!") do set /a "a=(((1%%e-1%%a)*60)+1%%f-1%%b)*6000+1%%g%%h-1%%c%%d, a+=(a>>31) & 8640000"
echo Ambient trasmission: Execution time: %a%
goto :next_test2
AEScore_set_part_noset.bat:
@echo off & setlocal EnableDelayedExpansion
set lectures=10000
For /L %%j in (1,1,%lectures%) do ( echo !S[50]! > nul )
set /a "r=(%random% * %random%) %% 10"
if !r! lss 2 echo !r! child s[50]:!S[50]!
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:next_test2
rem work in progress