/* Copyright (c) 2016-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "buffer.h"
#include "hash-method.h"
#include "hmac.h"
#include "pkcs5.h"
#include <stdint.h>
static
{
if (length < 1 ||
length--;
}
return 0;
}
static
{
size_t l = (length + hash->digest_size - 1)/hash->digest_size; /* same as ceil(length/hash->digest_size) */
unsigned char *block;
unsigned int c,i,t;
for(t = 0; t < l; t++) {
/* U_1 = PRF(Password, Salt|| INT_BE32(Block_Number)) */
c = htonl(t+1);
hmac_update(&hctx, &c, sizeof(c));
/* block = U_1 ^ .. ^ U_iter */
/* U_c = PRF(Password, U_c-1) */
for(c = 1; c < iter; c++) {
for(i = 0; i < hash->digest_size; i++)
}
}
return 0;
}
{
if (mode == PKCS5_PBKDF1)
else if (mode == PKCS5_PBKDF2)
i_unreached();
}