Exemple #1
0
func SignEd25519SKToPK(pkOut []byte, sk []byte) int {
	support.CheckSize(pkOut, SignPublicKeyBytes(), "public key output")
	support.CheckSize(sk, SignSecretKeyBytes(), "secret key")

	return int(C.crypto_sign_ed25519_sk_to_pk(
		(*C.uchar)(&pkOut[0]), (*C.uchar)(&sk[0])))
}
Exemple #2
0
// PublicKey obtains the public component of an EdDSA private key.
func (priv EdDSAPrivate) PublicKey() EdDSAPublic {
	toret := make([]byte, EdDSAPublicLength)
	rv := C.crypto_sign_ed25519_sk_to_pk((*C.uchar)(&toret[0]),
		(*C.uchar)(&priv[0]))
	if rv != 0 {
		panic("crypto_sign_ed25519_sk_to_pk returned non-zero")
	}
	return toret
}