From 9997fdaffbd9b5061fb7292c8720bce89e64072f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 5 Mar 2019 07:01:54 -0800 Subject: doc: justify lack of seed keyword in hash construction. * txr.1: The hash function doesn't support a keyword like :seed to specify the hash seed. Adding an explanation of why. Spoiler: security reason. --- txr.1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/txr.1 b/txr.1 index 67e007e7..34fac7dc 100644 --- a/txr.1 +++ b/txr.1 @@ -40971,6 +40971,14 @@ specifies the user data for the hash table, which can be retrieved using the .code hash-userdata function. +Note: there doesn't exist a keyword for specifying the seed. +This omission is deliberate. These hash construction keywords may appear in the +hash literal +.code #H +syntax. A seed keyword would allow literals to specify their own seed, which +would allow malicious hash literals to be crafted that perpetrate a hash +collision attack against the parser. + .coNP Functions @, hash-construct @ hash-from-pairs and @ hash-from-alist .synb .mets (hash-construct < hash-args << key-val-pairs ) -- cgit v1.2.3