File: cavp_entry.h

package info (click to toggle)
libreswan 5.2-2.4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 81,656 kB
  • sloc: ansic: 129,988; sh: 32,018; xml: 20,646; python: 10,303; makefile: 3,022; javascript: 1,506; sed: 574; yacc: 511; perl: 264; awk: 52
file content (52 lines) | stat: -rw-r--r-- 2,118 bytes parent folder | download | duplicates (4)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* Parse CAVP test vectors, for libreswan
 *
 * Copyright (C) 2015-2016,2018, Andrew Cagney <cagney@gnu.org>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.  See <https://www.gnu.org/licenses/gpl2.txt>.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

#include "chunk.h"
#include "lswnss.h"

struct integ_desc;
struct prf_desc;
struct encrypt_desc;
struct hash_desc;
struct logger;

struct cavp_entry {
	const char *key;
	const char *opt; /* name from ACVP json */
	void (*op)(const struct cavp_entry *key, const char *value, struct logger *logger);
	/* set by the below */
	chunk_t *chunk;
	PK11SymKey **symkey;
	signed long *signed_long;
	unsigned long *unsigned_long;
	const struct cavp_entry **entry;
	/* constant values */
	int value;
	const struct encrypt_desc *encrypt;
	const struct hash_desc *hash;
	const struct prf_desc *prf;
	const struct integ_desc *integ;
};

void op_entry(const struct cavp_entry *entry, const char *value, struct logger *logger);
void op_ignore(const struct cavp_entry *entry, const char *value, struct logger *logger);
void op_chunk(const struct cavp_entry *entry, const char *value, struct logger *logger);
void op_symkey(const struct cavp_entry *entry, const char *value, struct logger *logger);
void op_signed_long(const struct cavp_entry *entry, const char *value, struct logger *logger);
void op_unsigned_long(const struct cavp_entry *entry, const char *value, struct logger *logger);
void op_boolean(const struct cavp_entry *entry, const char *value, struct logger *logger);

const struct cavp_entry *cavp_entry_by_key(const struct cavp_entry *entries, const char *key);
const struct cavp_entry *cavp_entry_by_opt(const struct cavp_entry *entries, const char *opt);