|Anonymous | Login | Signup for a new account||2014-10-25 11:39 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005005||OCaml||OCaml otherlibs||public||2010-03-19 10:18||2014-05-04 14:29|
|Target Version||Fixed in Version|
|Summary||0005005: Lowlevel interface to Digest and Bigarray support|
the attached patches add a more lowlevel interface to the Digest module allowing the creation of a context and updating the context with any number of strings before finaling it to create the overall digest. It further adds a Bigarray.Array1.Digest module that allows computing the digest of an array or updating a context with an array. The more lowelevel interface allows creating a digest from e.g. a rope, which internally is a sequenze of strings.
As a special bonus the digesting of a bigarray is done with caml_enter/leave_blocking_section() and can run concurrently with other threads to take advantage of multiple cores. It might be wise to add a size check and only go into a blocking section if the array is larger than for example Page_size.
Unfortunately the same can't be done for strings as the GC can move them while being digested in a blocking section. So digesting strings can not take advantage of multiple cores.
|Additional Information||The patch is split into 2 parts. The changes to md5.c/md5.h must be applied first and the compiler must be bootstraped to get the new functions listed as primitives. Only then, in a second pass, can the remaining patch be build.|
|Attached Files|| 0008-md5-rewrite.patch [^] (4,436 bytes) 2010-03-19 10:18 [Show Content]
0009-digest-rewrite.patch [^] (6,479 bytes) 2010-03-19 10:18 [Show Content]
I have to mention that "The digests are of cryptographic quality: it is very hard, given a digest, to forge a string having that digest." is no longer true. It is trivial to forge an md5 digest, e.g. see http://fixunix.com/linux/494226-md5-collisions-made-easy.html. [^]
I want to point out that improving the Digest module would invite new usage of it, whereas the right thing to do is to use SHA256 or newer hash functions from cryptokit or a similar external package.
|2010-03-19 10:18||goswin||New Issue|
|2010-03-19 10:18||goswin||File Added: 0008-md5-rewrite.patch|
|2010-03-19 10:18||goswin||File Added: 0009-digest-rewrite.patch|
|2011-06-01 17:08||doligez||Status||new => acknowledged|
|2012-06-21 20:16||frisch||Category||OCaml general => OCaml otherlibs|
|2013-09-05 11:40||doligez||Tag Attached: patch|
|2014-05-04 14:29||whitequark||Note Added: 0011342|
|Copyright © 2000 - 2011 MantisBT Group|