Skip to content

DECODEproject/zenroom-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.