Luzifer / go-openssl

go-openssl is a small library wrapping the crypto/aes functions in a way the output is compatible to OpenSSL
Apache License 2.0
122 stars 33 forks source link

BytesToKeyMD5 and PBKDF2SHA256 #23

Closed buzzy closed 2 years ago

buzzy commented 2 years ago

In the encrypt/decrypt example, the third parameter is BytesToKeyMD5 and PBKDF2SHA256. Where are these coming from? It's not clear where they are defined and the example do not compile without errors the way they stand now.

./main.go:286:62: undefined: BytesToKeyMD5

It seems to compile cleanly if it's replaced with openssl.BytesToKeyMD5 though.

Luzifer commented 2 years ago

It seems to compile cleanly if it's replaced with openssl.BytesToKeyMD5 though.

You answered your question. As the example is within the openssl package it does not reference the package. If you use it outside of the package you need to reference those functions by specifying the package.