-
Notifications
You must be signed in to change notification settings - Fork 182
expose API for further hashing operations: process(), finish() and reset() #55
Comments
Not exactly: #38 Firefox had a bug preventing asm.js module being re-linked with another heap object. That's why current API reuses static objects and exposes only one-shot operations. |
It's fixed now: http://hg.mozilla.org/mozilla-central/rev/2a34429afff1 |
Oh, that's awesome. I had a try with FF 31 and it works. Do you know the exact FF version from which we can be sure this bug is fixed? |
OK, good to know the reasoning for statically fixing this. But, now that it's resolved, it would be really good to get access to a digest object instance and use the different methods on it as needed. |
I think this might be the Firefox bug link in question: Maybe that helps in finding out when it was resolved. This link suggests, that it might have been fixed in a nightly of 30a1: |
It seems we can safely remove this support, Firefox 29 has practically zero usage now. |
Is there some kind of expectation, when a constructor to a hashing instance will be exported through the public API? |
It's already done with 63fa6aa and as for other potentially unsafe things turned off by default. Also I'd like to put some tests for this feature. Suppose it'll be finished till the end of this week. |
Excellent. Thanks for that. So I suppose one would create a new instance using |
Yep, you right. |
When computing message digests of large amounts of data, the currently exposed hashing functions (e. g.
SHA256.bytes(data)
) are not sufficient. One needs to obtain an instance on a message digest object, and thenprocess(data)
on the object as it comes in, to finally get the result via afinish()
call on it. It then could be reused for other/future message digest operations.src/sha256/exports.js
for example does this already with thesha256_bytes(data)
function (mapped toasmCrypto.SHA256.bytes(data)
:return get_sha256_instance().reset().process(data).finish().result;
So I guess it's a matter of just exposing this part of the implementation to the outside API.
The text was updated successfully, but these errors were encountered: