Source file src/runtime/dit.go

     1  // Copyright 2025 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 runtime
     6  
     7  import (
     8  	"internal/runtime/sys"
     9  	_ "unsafe"
    10  )
    11  
    12  //go:linkname dit_setEnabled crypto/subtle.setDITEnabled
    13  func dit_setEnabled() bool {
    14  	g := getg()
    15  	g.ditWanted = true
    16  	g.m.ditEnabled = true
    17  	return sys.EnableDIT()
    18  }
    19  
    20  //go:linkname dit_setDisabled crypto/subtle.setDITDisabled
    21  func dit_setDisabled() {
    22  	g := getg()
    23  	g.ditWanted = false
    24  	g.m.ditEnabled = false
    25  	sys.DisableDIT()
    26  }
    27  

View as plain text