summaryrefslogtreecommitdiff
path: root/cp/secu/secu.h
blob: 5ed00a28bd2ea938c90fd84a8a9113d66fae74b9 (plain)
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
/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp/secu/seculib.h
 * \brief   All functions related to keys, protocolrun and security
 * \ingroup cp_secu
 */

#ifndef seculib__h__
#define seculib__h__

#include <stdio.h>
#include <stdlib.h>

#include "cp/secu/inc/secu_types.h"
#include "cp/secu/inc/secu_pbkdf1.h"
#include "cp/secu/inc/secu_p_run.h"

/**
 * initialize the secu module
 * \param  p_sec  ref to the struct
 */
void 
secu_init (sec_t *p_sec);

/**
 * hash password
 * \param pwd_type      the password type (DPW, NMK, NPW)
 * \param in            password to hash
 * \param key           obtained key from password
 * \return error code or 0 if success
 */
E_ErrCode 
secu_hash (pwd_type_t pwd_type, u8 in[], u8 out[]);

/**
 * AES key generation
 * \param key           generated key, AES_KEY_SIZE (in bytes)
 * \return              error code or 0 if success
 */
E_ErrCode 
secu_gen_aes_key (u8 key[]);



#endif