1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16static inline u32 split_key_len(u32 hash)
17{
18
19 static const u8 mdpadlen[] = { 16, 20, 32, 32, 64, 64 };
20 u32 idx;
21
22 idx = (hash & OP_ALG_ALGSEL_SUBMASK) >> OP_ALG_ALGSEL_SHIFT;
23
24 return (u32)(mdpadlen[idx] * 2);
25}
26
27
28
29
30
31
32
33
34static inline u32 split_key_pad_len(u32 hash)
35{
36 return ALIGN(split_key_len(hash), 16);
37}
38
39struct split_key_result {
40 struct completion completion;
41 int err;
42};
43
44void split_key_done(struct device *dev, u32 *desc, u32 err, void *context);
45
46int gen_split_key(struct device *jrdev, u8 *key_out,
47 struct alginfo * const adata, const u8 *key_in, u32 keylen,
48 int max_keylen);
49