ソースを参照

Fix issues with keyed hash API.

tags/1.0.7
Vsevolod Stakhov 8年前
コミット
293fbe463c

+ 4
- 10
src/libcryptobox/blake2/blake2.c ファイルの表示

blake2b_keyed_init (blake2b_state *S, const unsigned char *key, size_t keylen) blake2b_keyed_init (blake2b_state *S, const unsigned char *key, size_t keylen)
{ {
unsigned char k[BLAKE2B_BLOCKBYTES] = {0}; unsigned char k[BLAKE2B_BLOCKBYTES] = {0};
if (keylen > BLAKE2B_KEYBYTES) {
fprintf (stderr,
"key size larger than %u passed to blake2b_keyed_init",
BLAKE2B_KEYBYTES);
exit (-1);
}
else {
memcpy (k, key, keylen);
}

g_assert (keylen <= BLAKE2B_KEYBYTES);
memcpy (k, key, keylen);
blake2b_init (S); blake2b_init (S);
blake2b_update (S, k, BLAKE2B_BLOCKBYTES); blake2b_update (S, k, BLAKE2B_BLOCKBYTES);
} }
} }
} }
} }
}
}

+ 1
- 1
src/libcryptobox/blake2/blake2.h ファイルの表示

const unsigned char *key, const unsigned char *key,
size_t keylen); size_t keylen);


int blake2b_load (void);
void blake2b_load (void);


#if defined(__cplusplus) #if defined(__cplusplus)
} }

+ 1
- 0
src/libcryptobox/cryptobox.h ファイルの表示

#define rspamd_cryptobox_MAX_NMBYTES 32 #define rspamd_cryptobox_MAX_NMBYTES 32
#define rspamd_cryptobox_SIPKEYBYTES 16 #define rspamd_cryptobox_SIPKEYBYTES 16
#define rspamd_cryptobox_HASHBYTES 64 #define rspamd_cryptobox_HASHBYTES 64
#define rspamd_cryptobox_HASHKEYBYTES 64
#define rspamd_cryptobox_HASHSTATEBYTES 256 #define rspamd_cryptobox_HASHSTATEBYTES 256


typedef guchar rspamd_pk_t[rspamd_cryptobox_MAX_PKBYTES]; typedef guchar rspamd_pk_t[rspamd_cryptobox_MAX_PKBYTES];

読み込み中…
キャンセル
保存