Luzifer / go-openssl

go-openssl is a small library wrapping the crypto/aes functions in a way the output is compatible to OpenSSL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unresolved reference 'DigestSHA256Sum'

9thwall opened this issue · comments

commented

Sorry for this noob issue but I'm getting 'Unresolved reference 'DigestSHA256Sum' setting up a simple test. What am I missing?

package main

import (
	"fmt"
	"github.com/Luzifer/go-openssl"
)


func main() {

	opensslEncrypted := "myencryptedstring"
	passphrase := "mypassphrase"

	o := openssl.New()

	dec, err := o.DecryptBytes(passphrase, []byte(opensslEncrypted), DigestSHA256Sum)
	if err != nil {
		fmt.Printf("An error occurred: %s\n", err)
	}

	fmt.Printf("Decrypted text: %s\n", string(dec))
}

You are trying to use a variable / constant from your own package (main) with the name DigestSHA256Sum. As this constant is declared in the openssl package you need to reference it as openssl.DigestSHA256Sum

In the examples and test-code this is possible as those examples already are inside the openssl package.

commented

Thank you! That did it.