google / go-tpm-tools

Go packages built on go-tpm providing a high-level API for using TPMs
Apache License 2.0
229 stars 71 forks source link

Increasing MAX_NV_BUFFER_SIZE to 2048 #456

Closed Daviiap closed 3 months ago

Daviiap commented 5 months ago

To match most vTPMs implementations, the MAX_NV_BUFFER_SIZE has been increased to 2048

jkl73 commented 5 months ago

We use the simulator mainly for running tests.

Did you run into any out-of-nvbuffer issue?

Instead of changing the header file directly, I prefer to let it stay the same as the upstream. Could you add a CFLAGS in internal_cgo.go to overwrite macro when running your code? like

// #cgo CFLAGS: -DMAX_NV_BUFFER_SIZE=2048
// #cgo CFLAGS: -DNV_MEMORY_SIZE=32768