diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2020-03-01 22:27:56 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-03-01 23:14:55 +0100 |
commit | 3157d1f06e37906fd8821d2d869c40eac0d2b38c (patch) | |
tree | 5aeb6fab42c5f2cf8ed4c06c458c024315f2eb2a /doc/it | |
parent | 9a6a27ef58982319549529d43906da60ce199aaf (diff) | |
download | weechat-3157d1f06e37906fd8821d2d869c40eac0d2b38c.zip |
api: add function crypto_hash_pbkdf2
Diffstat (limited to 'doc/it')
-rw-r--r-- | doc/it/weechat_plugin_api.it.adoc | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index 0705b9522..dbd38850b 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -3497,6 +3497,7 @@ Argomenti: * _hash_size_: pointer to a variable used to store the length of the hash computed (in bytes) (can be NULL) +[[crypto_hash_algorithms]] Supported hash algorithms: [width="100%",cols="2,2,3,6",options="header"] @@ -3517,7 +3518,6 @@ Supported hash algorithms: Valore restituito: -// TRANSLATION MISSING * 1 if OK, 0 if error Esempio in C: @@ -3535,6 +3535,61 @@ rc = weechat_crypto_hash (data, strlen (data), "sha256", hash, &hash_size); [NOTE] Questa funzione non è disponibile nelle API per lo scripting. +// TRANSLATION MISSING +==== crypto_hash_pbkdf2 + +_WeeChat ≥ 2.8._ + +Compute PKCS#5 Passphrase Based Key Derivation Function number 2 (PBKDF2) hash +of data. + +Prototipo: + +[source,C] +---- +int weechat_crypto_hash_pbkdf2 (const void *data, int data_size, + const char *hash_algo, + const void *salt, int salt_size, + int iterations, + void *hash, int *hash_size); +---- + +Argomenti: + +* _data_: the data to hash +* _data_size_: number of bytes to hash in _data_ +* _hash_algo_: hash algorithm used by the key derivation function, see table + in function <<crypto_hash_algorithms,crypto_hash>> +* _salt_: the salt +* _salt_size_: number of bytes in _salt_ +* _iterations_: number of iterations +* _hash_: pointer to the hash variable, which is used to store the resulting hash + (the buffer must be large enough, according to the algorithm, see table in + function <<crypto_hash_algorithms,crypto_hash>>) +* _hash_size_: pointer to a variable used to store the size of the hash computed + (in bytes) (can be NULL) + +Valore restituito: + +* 1 if OK, 0 if error + +Esempio in C: + +[source,C] +---- +const char *data = "abcdefghijklmnopqrstuvwxyz"; +const char *salt = "12345678901234567890123456789012"; /* 32 bytes */ +char hash[256 / 8]; +int rc, hash_size; +rc = weechat_crypto_hash_pbkdf2 (data, strlen (data), "sha256", salt, strlen (salt), 100000, + hash, &hash_size); +/* rc == 1, hash_size == 32 and hash is a buffer with: + 99 b3 5e 42 53 d1 a7 a8 49 c1 dc 2c e2 53 c2 b6 6d a1 8b dc 6e 78 a7 06 e0 ef 34 db 0a 7a a2 bb */ +---- + +[NOTE] +Questa funzione non è disponibile nelle API per lo scripting. + [[directories]] === Cartelle |