Function report |
Source Code:fs\verity\open.c |
Create Date:2022-07-28 20:24:49 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:sverity_init_merkle_tree_params() - initialize Merkle tree parameters*@params: the parameters struct to initialize*@inode: the inode for which the Merkle tree is being built*@hash_algorithm: number of hash algorithm to use*@log_blocksize: log base 2 of
Proto:int fsverity_init_merkle_tree_params(struct merkle_tree_params *params, const struct inode *inode, unsigned int hash_algorithm, unsigned int log_blocksize, const u8 *salt, size_t salt_size)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct merkle_tree_params * | params | |
const struct inode * | inode | |
unsigned int | hash_algorithm | |
unsigned int | log_blocksize | |
const u8 * | salt | |
size_t | salt_size |
50 | If IS_ERR(itial hash state or NULL ) Then |
51 | err = PTR_ERR(itial hash state or NULL ) |
52 | itial hash state or NULL = NULL |
53 | fsverity_err(inode, "Error %d preparing hash state", err) |
54 | Go to out_err |
57 | If log_blocksize != PAGE_SHIFT determines the page size Then |
58 | fsverity_warn(inode, "Unsupported log_blocksize: %u", log_blocksize) |
61 | Go to out_err |
64 | size of data and tree blocks = 1 << log_blocksize |
70 | If size of data and tree blocks < 2 * same as hash_alg->digest_size Then |
71 | fsverity_warn(inode, "Merkle tree block size (%u) too small for hash algorithm \"%s\"", size of data and tree blocks , crypto API name, e.g. sha256 ) |
75 | Go to out_err |
80 | pr_debug("Merkle tree uses %s with %u-byte blocks (%u hashes/block), salt=%*phN\n", crypto API name, e.g. sha256 , size of data and tree blocks , umber of hashes per tree block , (int)salt_size, salt) |
92 | blocks = i_size + size of data and tree blocks - 1 >> log_blocksize |
100 | blocks = blocks + umber of hashes per tree block - 1 >> log2(hashes_per_block) |
107 | offset = 0 |
109 | blocks = Starting block index for each tree level, ordered from leaf level (0)* to root level ('num_levels - 1')[level] |
116 | Merkle tree size in bytes = offset << log_blocksize |
117 | Return 0 |
119 | out_err : |
122 | Return err |
Name | Describe |
---|---|
fsverity_create_info | Validate the given fsverity_descriptor and create a new fsverity_info from* it. The signature (if present) is also checked. |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |