Skip to content

Commit

Permalink
Add nonce to attestation report (#1)
Browse files Browse the repository at this point in the history
* Add nonce to attestation report

* Update generated modules

* Introduce new method for attestation report that accepts nonce

* Verify nonce size

Signed-off-by: Vadim Gribanov <[email protected]>
  • Loading branch information
yoihito committed Jan 13, 2025
1 parent 150a069 commit 97f6be2
Show file tree
Hide file tree
Showing 2 changed files with 338 additions and 321 deletions.
14 changes: 14 additions & 0 deletions pkg/nvml/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -2856,6 +2856,20 @@ func (device nvmlDevice) GetConfComputeGpuAttestationReport() (ConfComputeGpuAtt
return gpuAtstReport, ret
}

func (l *library) DeviceGetConfComputeGpuAttestationReportWithNonce(device Device, nonce []byte) (ConfComputeGpuAttestationReport, Return) {
return device.GetConfComputeGpuAttestationReportWithNonce(nonce)
}

func (device nvmlDevice) GetConfComputeGpuAttestationReportWithNonce(nonce []byte) (ConfComputeGpuAttestationReport, Return) {
if len(nonce) != CC_GPU_CEC_NONCE_SIZE {
return ConfComputeGpuAttestationReport{}, ERROR_INVALID_ARGUMENT
}
var gpuAtstReport ConfComputeGpuAttestationReport
copy(gpuAtstReport.Nonce[:], nonce)
ret := nvmlDeviceGetConfComputeGpuAttestationReport(device, &gpuAtstReport)
return gpuAtstReport, ret
}

// nvml.DeviceSetConfComputeUnprotectedMemSize()
func (l *library) DeviceSetConfComputeUnprotectedMemSize(device Device, sizeKiB uint64) Return {
return device.SetConfComputeUnprotectedMemSize(sizeKiB)
Expand Down
Loading

0 comments on commit 97f6be2

Please sign in to comment.