aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/p9auth/p9auth.h
blob: 285d1d8c9176b421ae22af032127db8d76e2b381 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef CAP_MAJOR
#define CAP_MAJOR 0
#endif

#ifndef CAP_NR_DEVS
#define CAP_NR_DEVS 2		/* caphash and capuse */
#endif

#ifndef CAP_NODE_SIZE
#define CAP_NODE_SIZE 20
#endif

#define MAX_DIGEST_SIZE  20

struct cap_node {
	char data[CAP_NODE_SIZE];
	struct list_head list;
};

struct cap_dev {
	struct cap_node *head;
	int node_size;
	unsigned long size;
	struct semaphore sem;
	struct cdev cdev;
};

extern int cap_major;
extern int cap_nr_devs;
extern int cap_node_size;

int cap_trim(struct cap_dev *);
ssize_t cap_write(struct file *, const char __user *, size_t, loff_t *);
char *cap_hash(char *plain_text, unsigned int plain_text_size, char *key, unsigned int key_size);
void hex_dump(unsigned char * buf, unsigned int len);