blocks_noasm.go raw

   1  // Copyright (c) 2024 The Decred developers
   2  // Use of this source code is governed by an ISC
   3  // license that can be found in the LICENSE file.
   4  //
   5  // Automatic selection originally written by Dave Collins July 2024.
   6  
   7  //go:build !amd64 || purego
   8  
   9  package compress
  10  
  11  // Blocks performs BLAKE-224 and BLAKE-256 block compression using pure Go.  It
  12  // will compress as many full blocks as are available in the provided message.
  13  //
  14  // The parameters are:
  15  //
  16  //	state: the block compression state with the chain value and salt
  17  //	msg: the padded message to compress (must be at least 64 bytes)
  18  //	counter: the total number of message bits hashed so far
  19  //
  20  // It will panic if the provided message block does not have at least 64 bytes.
  21  //
  22  // The chain value in the passed state is updated in place.
  23  func Blocks(state *State, msg []byte, counter uint64) {
  24  	blocksGeneric(state, msg, counter)
  25  }
  26