函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__chacha20poly1305_decrypt

函数原型:static bool __chacha20poly1305_decrypt(u8 *dst, const u8 *src, const size_t src_len, const u8 *ad, const size_t ad_len, u32 *chacha_state)

返回类型:bool

参数:

类型参数名称
u8 *dst
const u8 *src
const size_tsrc_len
const u8 *ad
const size_tad_len
u32 *chacha_state
130  pad0等于page_address(ZERO_PAGE(0))
134  union{u8 block0[32];u8 mac[16];__le64 lens[2];}b
140  如果此条件成立可能性小(为编译器优化)(src_len < POLY1305_DIGEST_SIZE)则返回:false
143  chacha20_crypt(chacha_state, block0, pad0, block0的长度)
144  poly1305_init( & poly1305_state, block0)
146  poly1305_update( & poly1305_state, ad, ad_len)
147  如果ad_len按位与0xf则poly1305_update( & poly1305_state, pad0, 0x10 - (ad_len & 0xf))
150  dst_len等于src_lenPOLY1305_DIGEST_SIZE
151  poly1305_update( & poly1305_state, src, dst_len)
152  如果dst_len按位与0xf则poly1305_update( & poly1305_state, pad0, 0x10 - (dst_len & 0xf))
155  lens[0]等于The following macros are to be defined by (ad_len)
156  lens[1]等于The following macros are to be defined by (dst_len)
157  poly1305_update( & poly1305_state, (u8 * )lens, lens的长度)
159  poly1305_final( & poly1305_state, mac)
161  ret等于rypto_memneq - Compare two areas of memory without leaking* timing information.*@a: One area of memory*@b: Another area of memory*@size: The size of the area.* Returns 0 when data is equal, 1 otherwise.
162  如果此条件成立可能性大(为编译器优化)(!ret)则chacha20_crypt(chacha_state, dst, src, dst_len)
165  memzero_explicit - Fill a region of memory (e
167  返回:非ret
调用者
名称描述
chacha20poly1305_decrypt
xchacha20poly1305_decrypt