github.com/insolar/x-crypto@v0.0.0-20191031140942-75fab8a325f6/sha1/sha1block_arm64.go (about)

     1  // Copyright 2017 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package sha1
     6  
     7  import "golang.org/x/sys/cpu"
     8  
     9  var k = []uint32{
    10  	0x5A827999,
    11  	0x6ED9EBA1,
    12  	0x8F1BBCDC,
    13  	0xCA62C1D6,
    14  }
    15  
    16  var hasSHA1 = cpu.ARM64.HasSHA1
    17  
    18  //go:noescape
    19  func sha1block(h []uint32, p []byte, k []uint32)
    20  
    21  func block(dig *digest, p []byte) {
    22  	if !hasSHA1 {
    23  		blockGeneric(dig, p)
    24  	} else {
    25  		h := dig.h[:]
    26  		sha1block(h, p, k)
    27  	}
    28  }