Skip to content
Go wrapper for liboqs; allows Go applications to use quantum-resistant KEMs
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
include/oqs Initial commit May 14, 2019
.travis.yml Restore pwd after liboqs install May 14, 2019
LICENSE Initial commit May 14, 2019
README.md
go.mod Initial commit May 14, 2019
go.sum Initial commit May 14, 2019
liboqs.go
liboqs_test.go Initial commit May 14, 2019

README.md

goliboqs

GoDoc Build Status

goliboqs is a Go wrapper around liboqs, which contains C implementations of NIST post-quantum candidate algorithms. This enables Go applications to use quantum-resistant key encapsulation mechanisms (KEMs) on Linux.

Usage

Sample usage is shown below. Error handling omitted for brevity.

// Load the library (don't forget to close)
lib, _ := goliboqs.LoadLib("/path/to/liboqs.so")
defer lib.Close()

// Get a particular KEM (don't forget to close)
kem, _ := lib.GetKem(goliboqs.KemKyber1024)
defer kem.Close()

// Use the kem...
publicKey, secretKey, _ := kem.KeyPair()
sharedSecret, ciphertext, _ := kem.Encaps(publicKey)
recoveredSecret, _ := kem.Decaps(ciphertext, secretKey)
// sharedSecret == recoveredSecret

Running tests

Tests assume liboqs has been installed into /usr/local/liboqs.

Related projects

go-tls-key-exchange is a fork of Go that supports bespoke key exchanges for TLS 1.3. When combined with this project, it enables quantum-resistant TLS in Go.

You can’t perform that action at this time.