Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\keyring.c Create Date:2022-07-28 18:17:07
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Hash a key type and description.

Proto:static void hash_key_type_and_desc(struct keyring_index_key *index_key)

Type:void

Parameter:

TypeParameterName
struct keyring_index_key *index_key
165  level_shift = ASSOC_ARRAY_LEVEL_STEP
166  fan_mask = ASSOC_ARRAY_FAN_MASK
167  description = description
171  desc_len = desc_len
173  type = type
174  acc = Multiply 64-bits by 32-bits to 96-bits and fold back to 64-bit. Ideally we'd* fold the carry back too, but that requires inline asm.
175  acc = Multiply 64-bits by 32-bits to 96-bits and fold back to 64-bit. Ideally we'd* fold the carry back too, but that requires inline asm.
176  piece = Domain of operation
177  acc = Multiply 64-bits by 32-bits to 96-bits and fold back to 64-bit. Ideally we'd* fold the carry back too, but that requires inline asm.
178  acc = Multiply 64-bits by 32-bits to 96-bits and fold back to 64-bit. Ideally we'd* fold the carry back too, but that requires inline asm.
180  cycle
181  n = desc_len
182  If n <= 0 Then Break
184  If n > 4 Then n = 4
186  piece = 0
187  memcpy( & piece, description, n)
188  description += n
189  desc_len -= n
190  acc = Multiply 64-bits by 32-bits to 96-bits and fold back to 64-bit. Ideally we'd* fold the carry back too, but that requires inline asm.
191  acc = Multiply 64-bits by 32-bits to 96-bits and fold back to 64-bit. Ideally we'd* fold the carry back too, but that requires inline asm.
195  hash = acc
196  If Key data retrieved in chunks of this size == 32 Then hash ^= acc >> 32
203  If type != key_type_keyring && (hash & fan_mask) == 0 Then hash |= hash >> Key data retrieved in chunks of this size - level_shift | 1
205  Else if type == key_type_keyring && (hash & fan_mask) != 0 Then hash = hash + (hash << level_shift) & ~fan_mask
207  Hash value = hash
Caller
NameDescribe
key_set_index_keyFinalise an index key to include a part of the description actually in the* index key, to set the domain tag and to calculate the hash.