Kukunin / webgl-scrypt

WebGL Scrypt implementation
GNU General Public License v2.0
33 stars 5 forks source link

Improving scrypt-async-js with specific WebGL optimized mixing functions #2

Open fpietrosanti opened 9 years ago

fpietrosanti commented 9 years ago

Hi Kukunin,

your WebGL-scrypt is a very cool project, smart idea, you're a web/js/crypto ninja.

I opened a discussion on performance comparison/profiling of JS scrypt libraries: http://lists.randombit.net/pipermail/cryptography/2015-May/007234.html

We are now using scrypt-async-js (https://github.com/dchest/scrypt-async-js/blob/master/scrypt-async.js) and we where discussing performance improvements opportunities https://github.com/dchest/scrypt-async-js/issues/9 .

Regarding the primitives used:

I wanted to ask you think that only the SalsaXOR and the BlockMix functions can become entirely WebGL done/optimized.

Would it be doable/possible/make-sense to have those functions only available as WebGL implemented?

Kukunin commented 9 years ago

Hey. Thanks for your interest =)

SHA256, HMAC etc take too little time comparing with salsa. Realize, that you need about 5 graphic calls to implement SHA256 and 150k for Salsa. You need 70 bytes for SHA256 and 128kb (131072 bytes) for salsa. So, that are main indicators, why webcrypto primitives wouldn't help.

There are still several approaches for WebGL scrypt:

fpietrosanti commented 9 years ago

@Kukunin Thanks to you for your research in this topic with such an hackish approach! ;-)

Kukunin commented 9 years ago

About the more "complex shared"?

No strict rules. I just tested on my notebook's Intel HD 4400 card, and desktop's Radeon HD 7950. If you increase the shader complexity a bit, they will stop to work on Intel HD 4400, while will continue on HD 7950. There are no strict rules. It seems to don't work in latest IE at all.

About the compute shaders

Glad to know, I haven't heard it before. Maybe, when I'll have some free time, I'll take a look