xref: /illumos-gate/usr/src/test/crypto-tests/tests/digest/parser_runner.h (revision 7b34a9a5df26271af0da06974fc361c468cd48d3)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License (), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2020 Oxide Computer Company
14  */
15 
16 #ifndef _PARSER_RUNNER_H_
17 #define	_PARSER_RUNNER_H_
18 
19 #include <sys/types.h>
20 
21 struct parser_ctx;
22 
23 struct parser_entry {
24 	uchar_t	*pe_msg;
25 	size_t	pe_msglen;
26 	uchar_t	*pe_hash;
27 };
28 
29 typedef struct parser_ctx parser_ctx_t;
30 typedef struct parser_entry parser_entry_t;
31 
32 parser_ctx_t *parser_init(const char *, size_t, int *);
33 void parser_fini(parser_ctx_t *);
34 parser_entry_t *parser_read(parser_ctx_t *, int *);
35 void parser_free(parser_entry_t *);
36 
37 int digest_runner(char *, const char *, size_t);
38 
39 #endif /* _PARSER_RUNNER_H_ */
40