bwesterb/go-xmssmt

Does not compile under Windows

sietseringers opened this issue · 3 comments

The compiler gives the following errors:

$ GOOS=windows GOARCH=amd64 go build
# github.com/bwesterb/go-xmssmt
./container.go:343:14: undefined: syscall.Mmap
./container.go:347:3: undefined: syscall.PROT_READ
./container.go:347:21: undefined: syscall.PROT_WRITE
./container.go:348:3: undefined: syscall.MAP_SHARED
./container.go:474:9: undefined: syscall.Munmap
./container.go:585:3: undefined: syscall.O_DIRECTORY
./container.go:644:15: undefined: syscall.Munmap

There are two parts to XMSSMT: generating and verifying signatures. To be efficient, generating signatures requires a cache. This cache currently uses a posix-style mmap which is not supported in Windows. I will disable the cache on Windows.

So I chose to simply use a portable version of mmap. See 77ef299

Does this fix it? (And do the tests pass?)

It compiles now, thanks! As to whether it or the tests work, I'm not sure yet as I'm cross-compiling to Windows and don't have a Windows machine available to test on at the moment.