libitx / eddy Goto Github PK
View Code? Open in Web Editor NEWA steady little Ed25519 library for Elixir.
License: Apache License 2.0
A steady little Ed25519 library for Elixir.
License: Apache License 2.0
Hey there, great library! I did notice one issue. Due to an invalid encoding setting in one system, I was passing jumbled keys around, and eddy crashed hard:
iex(5)> b64_vk = "AjXhpbLYvvzkWnNjSWocHAtWS/eokEsCkVTSm08gLfKL"
"AjXhpbLYvvzkWnNjSWocHAtWS/eokEsCkVTSm08gLfKL"
iex(6)> {:ok, bin} = Base.decode64 b64_vk
{:ok,
<<2, 53, 225, 165, 178, 216, 190, 252, 228, 90, 115, 99, 73, 106, 28, 28, 11,
86, 75, 247, 168, 144, 75, 2, 145, 84, 210, 155, 79, 32, 45, 242, 139>>}
iex(7)> Eddy.PubKey.from_bin bin
** (FunctionClauseError) no function clause matching in Eddy.Serializable.Encoder.Eddy.Point.normalize_y/1
The following arguments were given to Eddy.Serializable.Encoder.Eddy.Point.normalize_y/1:
# 1
<<2, 53, 225, 165, 178, 216, 190, 252, 228, 90, 115, 99, 73, 106, 28, 28, 11,
86, 75, 247, 168, 144, 75, 2, 145, 84, 210, 155, 79, 32, 45, 242, 139>>
Attempted function clauses (showing 1 out of 1):
defp normalize_y(<<bytes::binary-size(31), last>>)
(eddy 1.0.0) lib/eddy/point.ex:120: Eddy.Serializable.Encoder.Eddy.Point.normalize_y/1
(eddy 1.0.0) lib/eddy/point.ex:99: Eddy.Serializable.Encoder.Eddy.Point.parse/2
(eddy 1.0.0) lib/eddy/pub_key.ex:27: Eddy.Serializable.Encoder.Eddy.PubKey.parse/2
(eddy 1.0.0) lib/eddy/pub_key.ex:24: Eddy.PubKey.from_bin/2
iex:7: (file)
Probably because the key was the right "shape" but due to the aforementioned settings issue, it evidently made it through whatever checks were in place. It's no issue as I am further validating the data and also placing the from_bin in a try/catch but since it was a pretty hard crash, thought I'd let you know.
Thanks again for the great library, a joy to work with!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.