mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
internal, runtime: add internal fips bool
This commit is contained in:
@@ -22,7 +22,8 @@ type Task struct {
|
||||
state state
|
||||
|
||||
// This is needed for some crypto packages.
|
||||
FipsIndicator uint8
|
||||
FipsIndicator uint8
|
||||
FipsOnlyBypass bool
|
||||
|
||||
// State of the goroutine: running, paused, or must-resume-next-pause.
|
||||
// This extra field doesn't increase memory usage on 32-bit CPUs and above,
|
||||
|
||||
@@ -67,3 +67,18 @@ func fips_setIndicator(indicator uint8) {
|
||||
// This indicator is stored per goroutine.
|
||||
task.Current().FipsIndicator = indicator
|
||||
}
|
||||
|
||||
//go:linkname fips140_setBypass crypto/fips140.setBypass
|
||||
func fips140_setBypass() {
|
||||
task.Current().FipsOnlyBypass = true
|
||||
}
|
||||
|
||||
//go:linkname fips140_unsetBypass crypto/fips140.unsetBypass
|
||||
func fips140_unsetBypass() {
|
||||
task.Current().FipsOnlyBypass = false
|
||||
}
|
||||
|
||||
//go:linkname fips140_isBypassed crypto/fips140.isBypassed
|
||||
func fips140_isBypassed() bool {
|
||||
return task.Current().FipsOnlyBypass
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user