herumi / bls

288 stars 133 forks source link

Is bls thread-safe? #8

Closed moonfruit closed 5 years ago

moonfruit commented 5 years ago

Is bls thread-safe to use same curve to sign or verify concurrently? Is bls thread-safe to use different curve to sign or verify concurrently?

herumi commented 5 years ago

blsInit to change curve parameter is not thread safe. sign/verify and other operations are thread safe after blsInit is complete.

moonfruit commented 5 years ago

After I blsInit one curve, I can thread-safe use all the API to sign or verify. But if I want to use another curve, I should blsInit the one. And all the API worked under the new curve, and if I want to use the previous one, I should blsInit the previous one again. It means that bls does not support to use different curve at the same time. Am I right?

herumi commented 5 years ago

It means that bls does not support to use different curve at the same time.

Yes, bls does not support it.

moonfruit commented 5 years ago

OK, I get it, thank you!