Cryptographic Primitives
Andreas Raab
andreas.raab at gmx.de
Thu Oct 5 19:25:44 UTC 2006
tim Rowledge wrote:
>
> On 5-Oct-06, at 9:05 AM, Ron Teitelbaum wrote:
>
>> Thanks Tim the process sounds fine but before we go to the effort I would
>> like to know if there is a consensus that this is a good thing to do.
>
> Well that's definitely not for me to decide; I think it's perfectly
> sensible to make them available within the VMMaker world and that would
> leave it up to you (as in all you out there) to discuss the rest.
I'm +1 on the idea. The crypto prims are algorithms that are typically
chosen to execute in 32bit and we pay a heavy price running them inside
Squeak. Having primitified some myself (MD5 and RC4 in Croquet to be
precise) speedups of a 100x are typical (which I have previously only
seen for floating point code, not for integer heavy code). In addition,
crypto prims are tiny bits of inner loops - I'd be extremely surprised
if the difference in compiled VM code is anywhere near 50k or so.
Given the tradeoffs and the importance for Crypto in many application
domains, it seems like a good choice to include these primitives directly.
BTW, while we're at it: In Croquet, I've added a primitive to gather
entropy from the OS for seeding crypto RNGs securely; if the current
Crypto prims don't include that I would heavily lobby for including it -
while it's not difficult to write platform specific versions, having a
common abstraction over the vastly different means (a file on Unix, and
API call on Windows) is definitely helpful.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|