awnumar / memguard

Secure software enclave for storage of sensitive information in memory.
Apache License 2.0
2.5k stars 123 forks source link

Added buffer cast types #54

Closed jamesbcook closed 6 years ago

jamesbcook commented 6 years ago

Tried to reduce the amount of manually casting needed for buffer slices. Added the return of a pointer to the byte slice as it makes it easier to keep everything in the secure buffer.

awnumar commented 6 years ago

Hey, thanks for the PR. Since you're a first-time contributor, have a look at the contributing guide.

Regarding this particular change, I'm not yet convinced that it's needed. I feel as though it's just a game of whack-a-mole where we'd implement a bunch of methods that return arrays of specific lengths and then hope that no one needs an array of any other length.

Also, about BufferPointer, can you elaborate on a use-case for this?

jamesbcook commented 6 years ago

You're right. I'll close it for now. I used the pointer along with re writing one of the crypto packages to accept a pointer instead of using Go's []byte that we couldn't control.