45 const void *
data,
size_t data_len,
void *prf,
size_t prf_len )
65 for ( blk = 0 ;; blk++ ) {
72 if ( prf_len <=
sizeof (
out ) ) {
78 prf_len -=
sizeof (
out );
79 prf +=
sizeof (
out );
97 const void *salt,
size_t salt_len,
105 int next_size =
sizeof (
in );
109 blocknr =
htonl ( blocknr );
111 memcpy ( pass, passphrase, pass_len );
113 memcpy (
in + salt_len, &blocknr, 4 );
116 for ( i = 0; i < iterations; i++ ) {
121 for ( j = 0; j <
sizeof ( last ); j++ ) {
126 next_size =
sizeof ( last );
149 const void *salt,
size_t salt_len,
150 int iterations,
void *
key,
size_t key_len )
156 for ( blk = 1; blk <= blocks; blk++ ) {
158 iterations, blk, buf );
159 if ( key_len <=
sizeof ( buf ) ) {
165 key_len -=
sizeof ( buf );
166 key +=
sizeof ( buf );
void hmac_init(struct digest_algorithm *digest, void *ctx, const void *key, size_t key_len)
Initialise HMAC.
uint32_t data_len
Microcode data size (or 0 to indicate 2000 bytes)
struct golan_eq_context ctx
void * memcpy(void *dest, const void *src, size_t len) __nonnull
Keyed-Hashing for Message Authentication.
static void hmac_update(struct digest_algorithm *digest, void *ctx, const void *data, size_t len)
Update HMAC.
size_t strlen(const char *src)
Get length of string.
uint8_t block[3][8]
DES-encrypted blocks.
#define SHA1_CTX_SIZE
SHA-1 context size.
uint8_t data[48]
Additional event data.
void hmac_final(struct digest_algorithm *digest, void *ctx, void *hmac)
Finalise HMAC.
struct digest_algorithm sha1_algorithm
SHA-1 algorithm.
void * memset(void *dest, int character, size_t len) __nonnull