函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:chacha20poly1305_selftest

函数原型:bool __init chacha20poly1305_selftest(void)

返回类型:bool

参数:

7250  enum{MAXIMUM_TEST_BUFFER_LEN = 1UL << 12}
7252  u8 * computed_output = NULL, * heap_src = NULL
7254  success等于true
7256  heap_src等于kmalloc(MAXIMUM_TEST_BUFFER_LEN, GFP_KERNEL)
7257  computed_output等于kmalloc(MAXIMUM_TEST_BUFFER_LEN, GFP_KERNEL)
7258  如果非heap_src或非computed_output
7259  打印错误信息("chacha20poly1305 self-test malloc: FAIL\n")
7260  success = false
7261  转到:out
7264 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(chacha20poly1305_enc_vectors)循环
7265  memset(computed_output, 0, MAXIMUM_TEST_BUFFER_LEN)
7266  chacha20poly1305_selftest_encrypt(computed_output, input, ilen, assoc, alen, nonce, nlen, key)
7278  打印错误信息("chacha20poly1305 encryption self-test %zu: FAIL\n", i + 1)
7280  success = false
7284 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(chacha20poly1305_enc_vectors)循环
7285  如果nlen不等于8则继续下一循环
7287  内存复制(heap_src, input, ilen)
7289  初始化散列表项目
7291  chacha20poly1305_encrypt_sg_inplace( & sg_src, ilen, assoc, alen, get_unaligned_le64(nonce), key)
7301  打印错误信息("chacha20poly1305 sg encryption self-test %zu: FAIL\n", i + 1)
7303  success = false
7307 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(chacha20poly1305_dec_vectors)循环
7308  memset(computed_output, 0, MAXIMUM_TEST_BUFFER_LEN)
7309  ret等于chacha20poly1305_decrypt(computed_output, input, ilen, assoc, alen, get_unaligned_le64(nonce), key)
7322  打印错误信息("chacha20poly1305 decryption self-test %zu: FAIL\n", i + 1)
7324  success = false
7328 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(chacha20poly1305_dec_vectors)循环
7329  内存复制(heap_src, input, ilen)
7331  初始化散列表项目
7333  ret等于chacha20poly1305_decrypt_sg_inplace( & sg_src, ilen, assoc, alen, get_unaligned_le64(nonce), key)
7344  打印错误信息("chacha20poly1305 sg decryption self-test %zu: FAIL\n", i + 1)
7346  success = false
7350 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(xchacha20poly1305_enc_vectors)循环
7351  memset(computed_output, 0, MAXIMUM_TEST_BUFFER_LEN)
7352  xchacha20poly1305_encrypt(computed_output, input, ilen, assoc, alen, nonce, key)
7363  打印错误信息("xchacha20poly1305 encryption self-test %zu: FAIL\n", i + 1)
7365  success = false
7368 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(xchacha20poly1305_dec_vectors)循环
7369  memset(computed_output, 0, MAXIMUM_TEST_BUFFER_LEN)
7370  ret等于xchacha20poly1305_decrypt(computed_output, input, ilen, assoc, alen, nonce, key)
7383  打印错误信息("xchacha20poly1305 decryption self-test %zu: FAIL\n", i + 1)
7385  success = false
7389  out :
7390  kfree(heap_src)
7391  kfree(computed_output)
7392  返回:success
调用者
名称描述
mod_init