Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nuid/elliptic
Cross-platform elliptic curve arithmetic
https://github.com/nuid/elliptic
clj cljc cljs clojure clojurescript elliptic elliptic-curve elliptic-curve-arithmetic
Last synced: 24 days ago
JSON representation
Cross-platform elliptic curve arithmetic
- Host: GitHub
- URL: https://github.com/nuid/elliptic
- Owner: NuID
- License: apache-2.0
- Created: 2018-11-20T23:07:40.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-10-27T13:32:01.000Z (about 1 year ago)
- Last Synced: 2024-10-12T14:01:29.941Z (24 days ago)
- Topics: clj, cljc, cljs, clojure, clojurescript, elliptic, elliptic-curve, elliptic-curve-arithmetic
- Language: Clojure
- Homepage:
- Size: 138 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE.md
Awesome Lists containing this project
README
# nuid.elliptic
Cross-platform elliptic curve arithmetic.
Git issues and other communications are warmly welcomed. [[email protected]](mailto:[email protected])
## Requirements
[`jvm`](https://www.java.com/en/download/), [`node + npm`](https://nodejs.org/en/download/), [`clj`](https://clojure.org/guides/getting_started), [`shadow-cljs`](https://shadow-cljs.github.io/docs/UsersGuide.html#_installation)
## Clojure and ClojureScript
### tools.deps:
`{nuid/elliptic {:git/url "https://github.com/nuid/elliptic" :sha "..."}}`
### usage:
```
$ clj # or shadow-cljs node-repl
=> (require '[nuid.elliptic.curve.point :as point])
=> (require '[nuid.elliptic.curve :as curve])
=> (require '[nuid.transit :as transit])
=> (require '[nuid.bn :as bn])
=> (def c (curve/from ::curve/secp256k1))
=> (def g (curve/base c))
=> (def n (curve/order c))
=> (def k (bn/from "123333333333333333333333333333333333333333321"))
=> (def p (point/mul g k))
=> (def q (point/add g p))
```## Notes
`nuid.elliptic` primarily exists to abstract over platform-specific differences
and provide a common interface to the provided functionality across host
platforms. `nuid.elliptic` delegates directly to host implementions (e.g.
`bouncycastle` on the `jvm`, and `elliptic`, etc., in `node` and the browser).## Licensing
Apache v2.0 or MIT
## ⚠️ Disclaimer
This library is [property tested](https://github.com/clojure/test.check#testcheck)
to help verify implementation, but has not yet been audited by an independent
third party.