Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 1.56 KB

README.md

File metadata and controls

57 lines (38 loc) · 1.56 KB

Zenroom-Go

Build Status GoDoc

Zenroom Binding for Go

Introduction

Zenroom is a brand new virtual machine for fast cryptographic operations on Elliptic Curves. The Zenroom VM has no external dependencies, includes a cutting edge selection of C99 libraries and builds a small executable ready to run on: desktop, embedded, mobile, cloud and browsers (webassembly). This library adds a CGO wrapper for Zenroom, which aims to make the Zenroom VM easy to use from Go.

Installation

Currently the bindings are only available for Linux machines, but if this is your current environment you should be able to just do:

$ go get github.com/DECODEproject/zenroom-go

Usage

package main

import (
	"fmt"
	"log"

	"github.com/DECODEproject/zenroom-go"
)

	genKeysScript := []byte(`
		keyring = ecdh.new('ec25519')
		keyring:keygen()
		
		output = JSON.encode({
			public = keyring:public():base64(),
			private = keyring:private():base64()
		})
		print(output)
	`)
	
	keys, err := zenroom.Exec(genKeysScript)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Keys: %s", keys)

More Documentation

Contributors

The original Go bindings for Zenroom were created by @chespinoza, later updates by @smulube.