mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-10 12:55:48 +01:00
GHash: add note about randomness in hashing
To clarify our statements about being robust against outside attackers degrading the performance of your hashtable.
This commit is contained in:
parent
5286dbb7e1
commit
12060df9f1
@ -165,6 +165,11 @@
|
|||||||
* Using g_str_hash() in that situation might make your application
|
* Using g_str_hash() in that situation might make your application
|
||||||
* vulerable to <ulink url="https://lwn.net/Articles/474912/">Algorithmic Complexity Attacks</ulink>.
|
* vulerable to <ulink url="https://lwn.net/Articles/474912/">Algorithmic Complexity Attacks</ulink>.
|
||||||
*
|
*
|
||||||
|
* The key to choosing a good hash is unpredictability. Even
|
||||||
|
* cryptographic hashes are very easy to find collisions for when the
|
||||||
|
* remainder is taken modulo a somewhat predictable prime number. There
|
||||||
|
* must be an element of randomness that an attacker is unable to guess.
|
||||||
|
*
|
||||||
* Returns: the hash value corresponding to the key
|
* Returns: the hash value corresponding to the key
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user