Golang FrodoKEM implementation

Related tags

Network go-frodokem
Overview

FrodoKEM in Golang

Golang implementation of FrodoKEM: a Practical quantum-secure key encapsulation from generic lattices (https://frodokem.org). This implementation passes all KAT tests from the reference specification for all defined key sizes (640 / 976 / 1344) and variants (AES / SHAKE).

API

There is a demo app that uses every method in the API. i.e. methods for listing variants, for creating key pairs, encapsulating & dencapsulating kems, auxiliary methods reporting cipher-text length, key-length, variant name, etc. You can find it here: demo.go. The built binary will be placed in bin/demo (use make build to generate it).

You can also read the documentation using go doc -all in this package, or look at impl.go and types.go.

Complete usage Snippet:

import frodo "github.com/kuking/go-frodokem"

kem := frodo.Frodo640AES()
pk, sk := kem.Keygen()                // public-key, secret-key
ct, ssEnc, _ := kem.Encapsulate(pk)   // cipher-text, shared-secret
ssDec, _ := kem.Dencapsulate(sk, ct)  // recovered shared-secret
// ssEnc == ssDec

For a full key agreement example, see agreement_test.go.

Note on Concurrency

This library is stateless. A FrodoKEM struct (as returned by i.e. frodo.Frodo640AES()) can be used concurrently. Keys are immutable []byte and they can be shared between concurrent goroutines.

Author

Eduardo E.S. Riccardi, you can contact me via linkedin, or you could find my email address here.

Releases

v1.0.1 - 25 June 2020 - Fixed a possible timing attack #2

v1.0.0 - 10 June 2020 - Feature complete.

Pending

  • implement optimisations with SIMD instructions
You might also like...
Golang pow implementation client <-> server over UDP and TCP protocols
Golang pow implementation client - server over UDP and TCP protocols

Client - server over UDP and TCP pow protocol Denial-of-Service-attacks are a typical situation when providing services over a network. A method for

Golang implementation of JSON-RPC 2.0 server with generics

JSON-RPC 2.0 Golang implementation of JSON-RPC 2.0 server with generics. Go 1.18+ required Features: Batch request and responses WebSockets Usage Crea

A diffie-hellman socket implementation in golang.

I tried to implement the diffie hellman key exchange in golang with the use of sockets to understand how this protocol works and to learn golang. So its a development project: obviously don't use it in production.

Ratelimit - This package provides a Golang implementation of the leaky-bucket rate limit algorithm

Go rate limiter This package provides a Golang implementation of the leaky-bucke

A go implementation of the STUN client (RFC 3489 and RFC 5389)

go-stun go-stun is a STUN (RFC 3489, 5389) client implementation in golang (a.k.a. UDP hole punching). RFC 3489: STUN - Simple Traversal of User Datag

A QUIC implementation in pure go
A QUIC implementation in pure go

A QUIC implementation in pure Go quic-go is an implementation of the QUIC protocol in Go. It implements the IETF QUIC draft-29 and draft-32. Version c

Fast RFC 5389 STUN implementation in go

STUN Package stun implements Session Traversal Utilities for NAT (STUN) [RFC5389] protocol and client with no external dependencies and zero allocatio

Pure Go implementation of the WebRTC API
Pure Go implementation of the WebRTC API

Pion WebRTC A pure Go implementation of the WebRTC API New Release Pion WebRTC v3.0.0 has been released! See the release notes to learn about new feat

A Socket.IO backend implementation written in Go

go-socket.io The socketio package is a simple abstraction layer for different web browser- supported transport mechanisms. It is fully compatible with

Comments
  • Needs to avoid branching on secret data

    Needs to avoid branching on secret data

    I think your code has similar problem as the one described by Qian Guo, Thomas Johansson, Alexander Nilsson. "A key-recovery timing attack on post-quantum primitives using the Fujisaki-Okamoto transformation and its application on FrodoKEM. " https://eprint.iacr.org/2020/743

    The interesting line would be this one:

    https://github.com/kuking/go-frodokem/blob/d2e4b12cdb154094bf4a7715563876080081e4d0/impl.go#L145

    But it is intersting stuff.

    Kind regards, Kris Kwiatkowski

    opened by kriskwiatkowski 7
Releases(v1.0.2)
Owner
Ed Riccardi
I do mostly Software and sometimes Businesses.
Ed Riccardi
Implementation of the FTPS protocol for Golang.

FTPS Implementation for Go Information This implementation does not implement the full FTP/FTPS specification. Only a small subset. I have not done a

Marco Beierer 27 Mar 14, 2022
Golang implementation of Sliding Window Algorithm for distributed rate limiting.

slidingwindow Golang implementation of Sliding Window Algorithm for distributed rate limiting. Installation $ go get -u github.com/RussellLuo/slidingw

Luo Peng 336 Nov 22, 2022
Crank4go API Gateway Brief Introduction It is a Golang implementation of Crank4j

Crank4go API Gateway Brief Introduction It is a Golang implementation of Crank4j, which derived from Cranker. the follow introduction is quoted from t

null 124 May 16, 2022
Golang Implementation of Terse IBC

tibc-go Golang Implementation of Terse IBC build make build local testnet ./build/simd testnet --v 1 --chain-id test --keyring-backend file ./build/s

Bianjie Technology Inc. 19 Nov 7, 2022
iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.

iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.

Fabian Siegel 42 Aug 20, 2022
Reference Golang implementation of the Alphanet - Network of Momentum Phase 0

Zenon Node Reference Golang implementation of the Alphanet - Network of Momentum Phase 0. Building from source Building znnd requires both a Go (versi

null 18 Nov 13, 2022
gRPC Web implementation for Golang and TypeScript

gRPC-Web: Typed Frontend Development gRPC is a modern, HTTP2-based protocol, that provides RPC semantics using the strongly-typed binary data format o

Improbable Engineering 4.1k Nov 26, 2022
Official Golang implementation of the PANO protocol

Panoptis Official Golang implementation of the PANO protocol Building the source Building pano requires both a Go (version 1.14 or later) and a C comp

PanoptesDev 1 Dec 14, 2021
A Golang implementation of Google Widevine Proxy

Widevine Proxy A Golang implementation of Google Widevine Proxy Widevine Proxy G

null 7 Jun 5, 2022
An implementation of the Nano protocol written from scratch in Go (golang).

Go Nano An implementation of the Nano protocol written from scratch in Go (golang). About the Project A crypto currency has to be resilient to survive

Shania 0 Dec 28, 2021