summaryrefslogtreecommitdiff
path: root/cp/secu/inc/secu_pbkdf1.h
blob: 9d12c891e5fe2c73451d960e5029c11b4a3956e6 (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
/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp/secu/secu_pbkdf1.h
 * \brief   Fonction PBKDF1.
 * \ingroup cp_secu
 */

#ifndef pbkdf1__h__
#define pbkdf1__h__

#include <string.h>

#include "cp/secu/inc/secu_types.h"
#include "cp/secu/inc/secu_sha2.h"
#include "cp/secu/inc/secu_aes.h"

/**
 * Check that password is Homeplug AV compliant
 * Homeplug AV 1.0.10 chap 7.10.7.1
 * \param pwd_type      password type (DPW, NMK, NPW)
 * \param password      password to check
 * \return              error code or 0 if success
 */
E_ErrCode 
secu_check_password_validity (pwd_type_t pwd_type, u8 password[]);

/**
 * pbkdf1
 * \param input         the input data to hash (can be a clear ascii password)
 * \param input_len     length of input
 * \param salt          salt to apply to input data
 * \param salt_len      length of salt
 * \param it_count      iteration number for the hash function
 * \param output_key    result of hash
 * \return              error code or 0 if success
 */
E_ErrCode 
secu_pbkdf1 (u8 input[], int input_len, u8 salt[], int salt_len, int it_count, u8 output_key[]);

#endif