Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__chacha20poly1305_decrypt

Proto: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)

Type:bool

Parameter:

TypeParameterName
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  If Value for the false possibility is greater at compile time(src_len < POLY1305_DIGEST_SIZE) Then Return false
143  chacha20_crypt(chacha_state, block0, pad0, size of block0 )
144  poly1305_init( & poly1305_state, block0)
146  poly1305_update( & poly1305_state, ad, ad_len)
147  If ad_len & 0xf Then poly1305_update( & poly1305_state, pad0, 0x10 - (ad_len & 0xf))
150  dst_len = src_len - POLY1305_DIGEST_SIZE
151  poly1305_update( & poly1305_state, src, dst_len)
152  If dst_len & 0xf Then 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, size of 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  If Value is more likely to compile time(!ret) Then chacha20_crypt(chacha_state, dst, src, dst_len)
165  memzero_explicit - Fill a region of memory (e
167  Return Not ret
Caller
NameDescribe
chacha20poly1305_decrypt
xchacha20poly1305_decrypt