Author | SHA1 | Message | Date |
---|---|---|---|
M. J. Fromberger |
f9c6cc9306
|
rpc: use encoding/json rather than tmjson (#7670)
The main change here is to use encoding/json to encode and decode RPC parameters, rather than the custom tmjson package. This includes: - Update the HTTP POST handler parameter handling. - Add field tags to 64-bit integer types to get string encoding (to match amino/tmjson). - Add marshalers to struct types that mention interfaces. - Inject wrappers to decode interface arguments in RPC handlers. |
3 years ago |
M. J. Fromberger |
dbe2146d0a
|
rpc: simplify the encoding of interface-typed arguments in JSON (#7600)
Add package jsontypes that implements a subset of the custom libs/json package. Specifically it handles encoding and decoding of interface types wrapped in "tagged" JSON objects. It omits the deep reflection on arbitrary types, preserving only the handling of type tags wrapper encoding. - Register interface types (Evidence, PubKey, PrivKey) for tagged encoding. - Update the existing implementations to satisfy the type. - Register those types with the jsontypes registry. - Add string tags to 64-bit integer fields where needed. - Add marshalers to structs that export interface-typed fields. |
3 years ago |
Yawning Angel |
c5cc3c8d3f
|
crypto: Use a different library for ed25519/sr25519 (#6526)
At Oasis we have spend some time writing a new Ed25519/X25519/sr25519 implementation called curve25519-voi. This PR switches the import from ed25519consensus/go-schnorrkel, which should lead to performance gains on most systems. Summary of changes: * curve25519-voi is now used for Ed25519 operations, following the existing ZIP-215 semantics. * curve25519-voi's public key cache is enabled (hardcoded size of 4096 entries, should be tuned, see the code comment) to accelerate repeated Ed25519 verification with the same public key(s). * (BREAKING) curve25519-voi is now used for sr25519 operations. This is a breaking change as the current sr25519 support does something decidedly non-standard when going from a MiniSecretKey to a SecretKey and or PublicKey (The expansion routine is called twice). While I believe the new behavior (that expands once and only once) to be more "correct", this changes the semantics as implemented. * curve25519-voi is now used for merlin since the included STROBE implementation produces much less garbage on the heap. Side issues fixed: * The version of go-schnorrkel that is currently imported by tendermint has a badly broken batch verification implementation. Upstream has fixed the issue after I reported it, so the version should be bumped in the interim. Open design questions/issues: * As noted, the public key cache size should be tuned. It is currently backed by a trivial thread-safe LRU cache, which is not scan-resistant, but replacing it with something better is a matter of implementing an interface. * As far as I can tell, the only reason why serial verification on batch failure is necessary is to provide more detailed error messages (that are only used in some unit tests). If you trust the batch verification to be consistent with serial verification then the fallback can be eliminated entirely (the BatchVerifier provided by the new library supports an option that omits the fallback if this is chosen as the way forward). * curve25519-voi's sr25519 support could use more optimization and more eyes on the code. The algorithm unfortunately is woefully under-specified, and the implementation was done primarily because I got really sad when I actually looked at go-schnorrkel, and we do not use the algorithm at this time. |
4 years ago |
Marko |
74cae49c3b
|
proto: leftover amino (#4986) | 5 years ago |
Erik Grinaker |
db8f1b3df3
|
migrate all JSON to new JSON encoder (#4975)
Uses new JSON encoder in #4955 for all JSON. Branched off of #4968. |
5 years ago |
Marko |
7c576f02ab
|
keys: change to []bytes (#4950) | 5 years ago |
Marko |
99d88cbe2f
|
crypto: remove key suffixes (#4941)
## Description - remove keyname suffix from keys Closes: #2228 |
5 years ago |
Marko |
044f1bf288
|
format: add format cmd & goimport repo (#4586)
* format: add format cmd & goimport repo - replaced format command - added goimports to format command - ran goimports Signed-off-by: Marko Baricevic <marbar3778@yahoo.com> * fix outliers & undo proto file changes |
5 years ago |
Sunny Aggarwal | b0bb8a1437 |
crypto: add sr25519 signature scheme (#4190)
* sr25519 * added amino encoding * fixed dependencies * Apply suggestions from code review Co-Authored-By: Tess Rinearson <tess.rinearson@gmail.com> Co-Authored-By: Marko <marbar3778@yahoo.com> * file structure * Apply suggestions from code review Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * address @melekes and @marbar3778 review * removed nolint * CHANGELOG and go-schnorrkel mod update |
5 years ago |