Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\crypto\chacha.c Create Date:2022-07-28 06:43:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:chacha_permute

Proto:static void chacha_permute(u32 *x, int nrounds)

Type:void

Parameter:

TypeParameterName
u32 *x
intnrounds
22  WARN_ON_ONCE(nrounds != 20 && nrounds != 12)
24  When i < nrounds cycle
25  x[0] += x[4]
25  x[12] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
26  x[1] += x[5]
26  x[13] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
27  x[2] += x[6]
27  x[14] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
28  x[3] += x[7]
28  x[15] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
30  x[8] += x[12]
30  x[4] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
31  x[9] += x[13]
31  x[5] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
32  x[10] += x[14]
32  x[6] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
33  x[11] += x[15]
33  x[7] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
35  x[0] += x[4]
35  x[12] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
36  x[1] += x[5]
36  x[13] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
37  x[2] += x[6]
37  x[14] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
38  x[3] += x[7]
38  x[15] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
40  x[8] += x[12]
40  x[4] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
41  x[9] += x[13]
41  x[5] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
42  x[10] += x[14]
42  x[6] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
43  x[11] += x[15]
43  x[7] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
45  x[0] += x[5]
45  x[15] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
46  x[1] += x[6]
46  x[12] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
47  x[2] += x[7]
47  x[13] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
48  x[3] += x[4]
48  x[14] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
50  x[10] += x[15]
50  x[5] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
51  x[11] += x[12]
51  x[6] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
52  x[8] += x[13]
52  x[7] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
53  x[9] += x[14]
53  x[4] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
55  x[0] += x[5]
55  x[15] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
56  x[1] += x[6]
56  x[12] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
57  x[2] += x[7]
57  x[13] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
58  x[3] += x[4]
58  x[14] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
60  x[10] += x[15]
60  x[5] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
61  x[11] += x[12]
61  x[6] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
62  x[8] += x[13]
62  x[7] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
63  x[9] += x[14]
63  x[4] = l32 - rotate a 32-bit value left*@word: value to rotate*@shift: bits to roll
Caller
NameDescribe
chacha_block_generichacha_block - generate one keystream block and increment block counter*@state: input state matrix (16 32-bit words)*@stream: output keystream block (64 bytes)*@nrounds: number of rounds (20 or 12; 20 is recommended)
hchacha_block_generichchacha_block_generic - abbreviated ChaCha core, for XChaCha*@state: input state matrix (16 32-bit words)*@out: output (8 32-bit words)*@nrounds: number of rounds (20 or 12; 20 is recommended)* HChaCha is the ChaCha equivalent of HSalsa and is an