函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\crypto\poly1305.c Create Date:2022-07-27 07:45:10
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:poly1305_core_blocks

函数原型:void poly1305_core_blocks(struct poly1305_state *state, const struct poly1305_key *key, const void *src, unsigned int nblocks, u32 hibit)

返回类型:void

参数:

类型参数名称
struct poly1305_state *state
const struct poly1305_key *key
const void *src
unsigned intnblocks
u32hibit
50  如果非nblocks则返回
53  r0等于 key, base 2^26 [0]
54  r1等于 key, base 2^26 [1]
55  r2等于 key, base 2^26 [2]
56  r3等于 key, base 2^26 [3]
57  r4等于 key, base 2^26 [4]
59  s1等于r1乘5
60  s2等于r2乘5
61  s3等于r3乘5
62  s4等于r4乘5
64  h0等于 accumulator, base 2^26 [0]
65  h1等于 accumulator, base 2^26 [1]
66  h2等于 accumulator, base 2^26 [2]
67  h3等于 accumulator, base 2^26 [3]
68  h4等于 accumulator, base 2^26 [4]
70  循环
72  h0加等于get_unaligned_le32(src + 0)右移0位按位与0x3ffffff
73  h1加等于get_unaligned_le32(src + 3)右移2位按位与0x3ffffff
74  h2加等于get_unaligned_le32(src + 6)右移4位按位与0x3ffffff
75  h3加等于get_unaligned_le32(src + 9)右移6位按位与0x3ffffff
76  h4加等于get_unaligned_le32(src + 12)右移8位按位或hibit左移24位
79  d0等于mlt(h0, r0)加mlt(h1, s4)加mlt(h2, s3)加mlt(h3, s2)加mlt(h4, s1)
81  d1等于mlt(h0, r1)加mlt(h1, r0)加mlt(h2, s4)加mlt(h3, s3)加mlt(h4, s2)
83  d2等于mlt(h0, r2)加mlt(h1, r1)加mlt(h2, r0)加mlt(h3, s4)加mlt(h4, s3)
85  d3等于mlt(h0, r3)加mlt(h1, r2)加mlt(h2, r1)加mlt(h3, r0)加mlt(h4, s4)
87  d4等于mlt(h0, r4)加mlt(h1, r3)加mlt(h2, r2)加mlt(h3, r1)加mlt(h4, r0)
91  d1加等于sr(d0, 26)
91  h0等于and(d0, 0x3ffffff)
92  d2加等于sr(d1, 26)
92  h1等于and(d1, 0x3ffffff)
93  d3加等于sr(d2, 26)
93  h2等于and(d2, 0x3ffffff)
94  d4加等于sr(d3, 26)
94  h3等于and(d3, 0x3ffffff)
95  h0加等于sr(d4, 26)乘5
95  h4等于and(d4, 0x3ffffff)
96  h1加等于h0右移26位
96  h0等于h0按位与0x3ffffff
98  src加等于POLY1305_BLOCK_SIZE
99 nblocks先自减循环
101  accumulator, base 2^26 [0]等于h0
102  accumulator, base 2^26 [1]等于h1
103  accumulator, base 2^26 [2]等于h2
104  accumulator, base 2^26 [3]等于h3
105  accumulator, base 2^26 [4]等于h4
调用者
名称描述
poly1305_update_generic
poly1305_final_generic