Source file src/internal/runtime/maps/memhash_aes.go

     1  // Copyright 2026 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  //go:build amd64 || arm64 || 386
     6  
     7  package maps
     8  
     9  import (
    10  	"unsafe"
    11  )
    12  
    13  const memHashAESImplemented = true
    14  
    15  func MemHash(p unsafe.Pointer, h, s uintptr) uintptr {
    16  	if UseAeshash {
    17  		return memHashAES(p, h, s)
    18  	}
    19  	return memHashFallback(p, h, s)
    20  }
    21  
    22  func MemHash32(p unsafe.Pointer, h uintptr) uintptr {
    23  	if UseAeshash {
    24  		return memHash32AES(p, h)
    25  	}
    26  	return memHash32Fallback(p, h)
    27  }
    28  
    29  func MemHash64(p unsafe.Pointer, h uintptr) uintptr {
    30  	if UseAeshash {
    31  		return memHash64AES(p, h)
    32  	}
    33  	return memHash64Fallback(p, h)
    34  }
    35  
    36  func StrHash(p unsafe.Pointer, h uintptr) uintptr {
    37  	if UseAeshash {
    38  		return strHashAES(p, h)
    39  	}
    40  	return strHashFallback(p, h)
    41  }
    42  

View as plain text