Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__chacha20poly1305_encrypt

Proto:static void __chacha20poly1305_encrypt(u8 *dst, const u8 *src, const size_t src_len, const u8 *ad, const size_t ad_len, u32 *chacha_state)

Type:void

Parameter:

TypeParameterName
u8 *dst
const u8 *src
const size_tsrc_len
const u8 *ad
const size_tad_len
u32 *chacha_state
62  pad0 = page_address(ZERO_PAGE(0))
64  union{u8 block0[32];__le64 lens[2];}b
69  chacha20_crypt(chacha_state, block0, pad0, size of block0 )
70  poly1305_init( & poly1305_state, block0)
72  poly1305_update( & poly1305_state, ad, ad_len)
73  If ad_len & 0xf Then poly1305_update( & poly1305_state, pad0, 0x10 - (ad_len & 0xf))
76  chacha20_crypt(chacha_state, dst, src, src_len)
78  poly1305_update( & poly1305_state, dst, src_len)
79  If src_len & 0xf Then poly1305_update( & poly1305_state, pad0, 0x10 - (src_len & 0xf))
82  lens[0] = The following macros are to be defined by (ad_len)
83  lens[1] = The following macros are to be defined by (src_len)
84  poly1305_update( & poly1305_state, (u8 * )lens, size of lens )
86  poly1305_final( & poly1305_state, dst + src_len)
88  memzero_explicit - Fill a region of memory (e
89  memzero_explicit - Fill a region of memory (e
Caller
NameDescribe
chacha20poly1305_encrypt
xchacha20poly1305_encrypt