函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:blake2s256_hmac

函数原型:void blake2s256_hmac(u8 *out, const u8 *in, const u8 *key, const size_t inlen, const size_t keylen)

返回类型:void

参数:

类型参数名称
u8 *out
const u8 *in
const u8 *key
const size_tinlen
const size_tkeylen
77  u8 x_key[BLAKE2S_BLOCK_SIZE]gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-aligned-function-attribute* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-aligned-type-attribute* gcc: https://gcc(()) = {0}
78  u8 i_hash[BLAKE2S_HASH_SIZEgcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-aligned-function-attribute* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-aligned-type-attribute* gcc: https://gcc(())
81  如果keylen大于BLAKE2S_BLOCK_SIZE
82  blake2s_init( & state, BLAKE2S_HASH_SIZE)
83  blake2s_update( & state, key, keylen)
84  blake2s_final( & state, x_key)
85  否则内存复制(x_key, key, keylen)
88 i小于BLAKE2S_BLOCK_SIZE循环x_key[i]异或等于0x36
91  blake2s_init( & state, BLAKE2S_HASH_SIZE)
92  blake2s_update( & state, x_key, BLAKE2S_BLOCK_SIZE)
93  blake2s_update( & state, in, inlen)
94  blake2s_final( & state, i_hash)
96 i小于BLAKE2S_BLOCK_SIZE循环x_key[i]异或等于0x5c按位异或0x36
99  blake2s_init( & state, BLAKE2S_HASH_SIZE)
100  blake2s_update( & state, x_key, BLAKE2S_BLOCK_SIZE)
101  blake2s_update( & state, i_hash, BLAKE2S_HASH_SIZE)
102  blake2s_final( & state, i_hash)
104  内存复制(out, i_hash, BLAKE2S_HASH_SIZE)
105  memzero_explicit - Fill a region of memory (e
106  memzero_explicit - Fill a region of memory (e
调用者
名称描述
blake2s_selftest