2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * @defgroup pts_meas_algo pts_meas_algo
21 #ifndef PTS_MEAS_ALGO_H_
22 #define PTS_MEAS_ALGO_H_
25 #include <crypto/hashers/hasher.h>
27 typedef enum pts_meas_algorithms_t pts_meas_algorithms_t
;
30 * PTS Measurement Algorithms
32 enum pts_meas_algorithms_t
{
33 PTS_MEAS_ALGO_SHA1
= (1<<15),
34 PTS_MEAS_ALGO_SHA256
= (1<<14),
35 PTS_MEAS_ALGO_SHA384
= (1<<13),
39 * Diffie-Hellman Hash Algorithm Values
40 * see section 3.8.5 of PTS Protocol: Binding to TNC IF-M Specification
43 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
44 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 * |1|2|3|R|R|R|R|R|R|R|R|R|R|R|R|R|
46 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
51 * Probe available PTS measurement algorithms
53 * @param algorithms set of available algorithms
54 * @return TRUE if mandatory algorithms are available
56 bool pts_meas_probe_algorithms(pts_meas_algorithms_t
*algorithms
);
59 * Convert pts_meas_algorithms_t to hash_algorithm_t
61 * @param algorithm PTS measurement algorithm type
62 * @return libstrongswan hash algorithm type
64 hash_algorithm_t
pts_meas_to_hash_algorithm(pts_meas_algorithms_t algorithm
);
66 #endif /** PTS_MEAS_ALGO_H_ @}*/