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/ja | |
parent | 9a6a27ef58982319549529d43906da60ce199aaf (diff) | |
download | weechat-3157d1f06e37906fd8821d2d869c40eac0d2b38c.zip |
api: add function crypto_hash_pbkdf2
Diffstat (limited to 'doc/ja')
-rw-r--r-- | doc/ja/weechat_plugin_api.ja.adoc | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index 887b8ec47..a31f4b15c 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -3374,6 +3374,7 @@ int weechat_crypto_hash (const void *data, int data_size, const char *hash_algo, * _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"] @@ -3411,6 +3412,60 @@ rc = weechat_crypto_hash (data, strlen (data), "sha256", hash, &hash_size); [NOTE] スクリプト API ではこの関数を利用できません。 +==== crypto_hash_pbkdf2 + +_WeeChat バージョン 2.8 以上で利用可。_ + +Compute PKCS#5 Passphrase Based Key Derivation Function number 2 (PBKDF2) hash +of data. + +プロトタイプ: + +[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); +---- + +引数: + +* _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) + +戻り値: + +* 成功した場合は 1、失敗した場合は 0 + +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] +スクリプト API ではこの関数を利用できません。 + [[directories]] === ディレクトリ |