summaryrefslogtreecommitdiff
path: root/UPGRADING
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2020-11-02 20:00:28 +0100
committerAnatol Belski <ab@php.net>2020-12-13 14:14:07 +0100
commit110b4e90946b6d46864c54c0e15b7a0deb6ad4b3 (patch)
tree709fa450d15d862e04866c213715f8791134f42c /UPGRADING
parent70c22dec2812bb7fec9d248268207b95f9cd4215 (diff)
downloadphp-git-110b4e90946b6d46864c54c0e15b7a0deb6ad4b3.tar.gz
hash: Support custom algo parameters
The concrete need on this change is to support passing an initial seed to the murmur hash. Passing a custom seed is important in terms of randomizing the hash function. The suggested implementation adds a HashTable parameter to all the init callbacks. Further on, an array with custom arguments is accepted from `hash` or `hash_init` from the user land. Currently several things like `hash_hkdf` are not touched, as they don't need passing custom args. Some convenience macros have been added to the SHA/MD families of functions, so the consuming code doesn't have to be changed widely. Another way to implement this is to add another type of the init that would accept a HT with arguments. However, that would still require touching all the context structs in all the algos. That would also increase the size of those structs. As an init function is called just once, the way of modifying the existing init callback has been seen as more preferrable. Closes GH-6400. Signed-off-by: Anatol Belski <ab@php.net> Co-Developed-by: Nikita Popov <nikita.ppv@googlemail.com> Signed-off-by: Nikita Popov <nikita.ppv@googlemail.com> Acked-by: Michael Wallner <mike@php.net> Reviewed-by: Máté Kocsis <kocsismate@woohoolabs.com> Reviewed-by: Eddie Kohler <ekohler@gmail.com>
Diffstat (limited to 'UPGRADING')
0 files changed, 0 insertions, 0 deletions