Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fpietrosanti opened this issue May 4, 2015 · 3 comments

Comments

@fpietrosanti
Copy link

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 dchest/scrypt-async-js#9 .

Regarding the primitives used:

  • SHA256 can be used from WebCrypto
  • PBKDF2 can be used from WebCrypto

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
Copy link
Owner

Kukunin commented May 5, 2015

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:

  • use more complex shaders. The problem, is that more weak cards refuse to load complex shaders. And the shader size is very limited
  • wait compute shader extension to be available on WebGL
  • wait WebCL

@Kukunin Kukunin closed this as completed May 5, 2015
@Kukunin Kukunin reopened this May 5, 2015
@fpietrosanti
Copy link
Author

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

  • About the more "complex shared"? Does those runs on modern computers? There's any mapping on which kind of graphics cards will accept more complex shaders? If the users coverage is wide-enough, then it's likely make sense
  • About the compute shaders, i read that those are already available in Chrome and Firefox, but must be manually enabled http://nopjia.blogspot.it/2014/06/webgl-gpu-particles.html .
    Wouldn't make sense to start implementing it already with compute shader, given that it can be tested/used? This Salsa/Mixing implementation would represent a valuable example of use, complementary to the WebCrypto!

@Kukunin
Copy link
Owner

Kukunin commented May 5, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants