Closed taimoorgit closed 3 years ago
Closing this issue - later in my program I called signer.Clean()
unnecessarily (in a different object, nonetheless!), which would wipe the secret key from memory. Relevant code from oqs.go
:
// Clean zeroes-in the stored secret key and resets the sig receiver. One can
// reuse the signature by re-initializing it with the Signature.Init method.
func (sig *Signature) Clean() {
if len(sig.secretKey) > 0 {
MemCleanse(sig.secretKey)
}
C.OQS_SIG_free(sig.sig)
*sig = Signature{}
}
Dear OQS team,
I have the following code:
I am confused as to why the output the value of
secretKey
is always00 00 00 ...
whereas thepublicKey
variable is always randomly generated, e.g.09 19 5D ...
It seems that providing a[]byte
tosigner.Init()
as the second argument makes no difference in this case.I thought that
GenerateKeyPair()
would generate both a private key and a public key. Am I wrong about this? Sorry if this is an obvious mistake, I am new to Go and cryptography in general.Using Windows 10 64-bit and 1.15.2 64-bit.