summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/en/weechat_plugin_api.en.adoc55
-rw-r--r--doc/fr/weechat_plugin_api.fr.adoc55
-rw-r--r--doc/it/weechat_plugin_api.it.adoc57
-rw-r--r--doc/ja/weechat_plugin_api.ja.adoc55
4 files changed, 221 insertions, 1 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc
index 677a756f6..ad284b573 100644
--- a/doc/en/weechat_plugin_api.en.adoc
+++ b/doc/en/weechat_plugin_api.en.adoc
@@ -3355,6 +3355,7 @@ Arguments:
* _hash_size_: pointer to a variable used to store the size of the hash computed
(in bytes) (can be NULL)
+[[crypto_hash_algorithms]]
Supported hash algorithms:
[width="100%",cols="2,2,3,6",options="header"]
@@ -3392,6 +3393,60 @@ rc = weechat_crypto_hash (data, strlen (data), "sha256", hash, &hash_size);
[NOTE]
This function is not available in scripting API.
+==== crypto_hash_pbkdf2
+
+_WeeChat ≥ 2.8._
+
+Compute PKCS#5 Passphrase Based Key Derivation Function number 2 (PBKDF2) hash
+of data.
+
+Prototype:
+
+[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);
+----
+
+Arguments:
+
+* _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)
+
+Return value:
+
+* 1 if OK, 0 if error
+
+C example:
+
+[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]
+This function is not available in scripting API.
+
[[directories]]
=== Directories
diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc
index e0449509f..d7e8e7a3d 100644
--- a/doc/fr/weechat_plugin_api.fr.adoc
+++ b/doc/fr/weechat_plugin_api.fr.adoc
@@ -3415,6 +3415,7 @@ Paramètres :
* _hash_size_ : pointeur vers une variable utiliser pour stocker la longueur
du résultat du hachage (en octets) (peut être NULL)
+[[crypto_hash_algorithms]]
Algorithmes de hachage supportés :
[width="100%",cols="2,2,3,6",options="header"]
@@ -3452,6 +3453,60 @@ rc = weechat_crypto_hash (data, strlen (data), "sha256", hash, &hash_size);
[NOTE]
Cette fonction n'est pas disponible dans l'API script.
+==== crypto_hash_pbkdf2
+
+_WeeChat ≥ 2.8._
+
+Calculer le hachage PBKDF2 (PKCS#5 Passphrase Based Key Derivation Function number 2)
+des données.
+
+Prototype :
+
+[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);
+----
+
+Paramètres :
+
+* _data_ : les données à hacher
+* _data_size_ : nombre d'octets à hacher dans _data_
+* _hash_algo_ : algorithme de hachage utilisé dans la fonction de dérivation
+ de clé, voir le tableau dans la fonction <<crypto_hash_algorithms,crypto_hash>>
+* _salt_ : le sel
+* _salt_size_ : nombre d'octets dans _salt_
+* _iterations_ : nombre d'itérations
+* _hash_ : pointeur vers la variable de hachage, qui est utilisée pour stocker
+ le résultat du hachage (le tampon doit être suffisamment grand, selon
+ l'algorithme, voir le tableau dans la fonction <<crypto_hash_algorithms,crypto_hash>>)
+* _hash_size_ : pointeur vers une variable utiliser pour stocker la longueur
+ du résultat du hachage (en octets) (peut être NULL)
+
+Valeur de retour :
+
+* 1 si OK, 0 si erreur
+
+Exemple en C :
+
+[source,C]
+----
+const char *data = "abcdefghijklmnopqrstuvwxyz";
+const char *salt = "12345678901234567890123456789012"; /* 32 octets */
+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 et hash est un tampon avec :
+ 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]
+Cette fonction n'est pas disponible dans l'API script.
+
[[directories]]
=== Répertoires
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
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]]
=== ディレクトリ