@mfikes : I've been deep-diving into the crypto.subtle
APIs lately, and I couldn't help but notice that planck doesn't seem to have crypto
available.
Is this because the JS VM under the hood is just jsc?
@xcthulhu No reason. Never been any interest in it I suppose.
Yeah, I sort of spend all my time writing polyfills around it TBH.
Down the road, as people want to do more and more with Planck, I think it would be a good idea to expose crypto.getRandomValues
Yeah, if there’s interest, we could add some native support to Planck and surface it via some namespace. (It would have to be portable native code.)
It's a niche thing - it only comes up when you are trying to make a random private key or non-RFC 6979 compliant legacy signature schemes.
But I would recommend simply implementing js/window.crypto
according to the spec - https://www.w3.org/TR/WebCryptoAPI/
One of the frustrating things about trying to do crypto with JS is that only FireFox and Chrome seem to follow this - IE, Safari, and Node.js all have other ideas.
</rant>