You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
553 B

4 years ago
4 years ago
  1. package babyjub
  2. import (
  3. "github.com/dchest/blake512"
  4. )
  5. // Note on dchest/blake512: This specific blake512 module is compatible with
  6. // the version of Blake512 used at circomlib, and this module has been reviewed
  7. // to don't be doing do anything suspicious.
  8. // Blake512 performs the blake-512 hash over the buffer m. Note that this is
  9. // the original blake from the SHA3 competition and not the new blake2 version.
  10. func Blake512(m []byte) []byte {
  11. h := blake512.New()
  12. _, err := h.Write(m[:])
  13. if err != nil {
  14. panic(err)
  15. }
  16. return h.Sum(nil)
  17. }