Hi I found the decryption cannot handle the empty string
It returns error "invalid length of message"
Is it possible to allow empty string in the future?
func TestEncryptAndDecrypt(t *testing.T) {
privkey, err := GenerateKey()
if !assert.NoError(t, err) {
return
}
testingEmptyStringMessage := ""
ciphertext, err := Encrypt(privkey.PublicKey, []byte(testingEmptyStringMessage))
if !assert.NoError(t, err) {
return
}
plaintext, err := Decrypt(privkey, ciphertext)
if !assert.NoError(t, err) {
return
}
assert.Equal(t, testingMessage, string(plaintext))
}
