ed25519-dalek-rustgo

Wrapper for curve25519-dalek using rustgo, a technique to directly call Rust code from Go programs with near-zero overhead, meant to replace manually written assembly.

  • 所有者: FiloSottile/ed25519-dalek-rustgo
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

ed25519-dalek-rustgo

Documentation

This repository is a demo for rustgo, a technique to directly call Rust code from Go programs with near-zero overhead, meant to replace manually written assembly.

You'd probably enjoy the article more.

edwards25519 implements operations on an Edwards curve that is isomorphic to curve25519 by wrapping the excellent pure-Rust curve25519-dalek library.

It exposes a Go interface, and can be imported, used and (cross-)compiled (but not installed) like a normal Go program. Benchmarks show this package to be more than 3 times faster than a pure-Go alternative.

Installation

To install using pre-built artifacts, download a tarball from the Releases page matching your Go version and untar it into $GOPATH. (The _haswell version is about 10% faster, but will only run on Haswell CPUs and newer.)

tar -C$GOPATH -xvf ed25519-dalek-rustgo_go1.8.3.tar.gz

That's it, you're ready to use the github.com/FiloSottile/ed25519-dalek-rustgo/edwards25519 package.

Manual installation

To build from source, you'll need Go, Rust, make and a linker.

Simply run make install from the root of this repository, which must be checked out at the right place in $GOPATH.

Cross-compilation is supported and based on GOOS/GOARCH. You'll need Rust setup and a linker for your target, specified with the LD variable. Set the MUSL environment variable to target x86_64-unknown-linux-musl for linux_amd64.

MUSL=1 GOOS=linux make clean install LD=x86_64-linux-musl-ld

The default RUSTFLAGS will target your native CPU.

Usage

Just what you're used to. Import it, call its functions, go build your program.

Cross-compilation works normally, as long as a .a was installed for the target. Binary distributions currently include darwin_amd64 and linux_amd64 pre-built archives.

The only function currently exposed is multiplication of a scalar by the Curve25519 basepoint into an Edwards compressed point. PRs to add more APIs are welcome.

主要指標

概覽
名稱與所有者FiloSottile/ed25519-dalek-rustgo
主編程語言Go
編程語言Makefile (語言數: 5)
平台
許可證MIT License
所有者活动
創建於2017-07-20 11:46:42
推送於2018-03-08 16:58:56
最后一次提交2017-08-14 02:37:38
發布數1
最新版本名稱v0.0.1 (發布於 )
第一版名稱v0.0.1 (發布於 )
用户参与
星數124
關注者數10
派生數12
提交數15
已啟用問題?
問題數0
打開的問題數0
拉請求數0
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?