alphazero / Blake2b

Java implementation of the BLAKE2b cryptographic hash function
Other
79 stars 22 forks source link

Thread safety #8

Closed GRYE closed 5 years ago

GRYE commented 5 years ago

Hi!

In readme I haven't found information about threadsafety of your implementation, can you provide me with this information?

alphazero commented 5 years ago

The contract conforms to the thread safety semantics of Java's MessageDigest. A digest is by definition a stateful construct and not thread-safe.

If you need to process multiple messages concurrently, simply use an instance of the digest per thread/worker. Each instance will have a fixed memory cost per it's state data structs.