Giter Club home page Giter Club logo

Comments (5)

burdges avatar burdges commented on August 23, 2024

Can you explain what fails in https://github.com/w3f/schnorrkel/blob/master/src/serdey.rs please? A priori I'd expect visit_seq should fail when invoked upon a simple byte array because that's what visit_bytes does, no?

Appears ed25519-dalek used serde_bytes without using Bytes anyplace.

from schnorrkel.

 avatar commented on August 23, 2024

I don't understand why the issue was closed...?
There's nothing failing in serdey per se, it's just that not all format specialise sequence of bytes as just bytes, json being one of those...
This poses an issue with the current implementation during deserialization, with the reported error, where a sequence is encountered but serdey doesn't handle it

from schnorrkel.

burdges avatar burdges commented on August 23, 2024

I just pressed the wrong button due to it being late..

Do we need a serde_bytes feature like ed25519-dalek added? If so, we're basically replaying dalek-cryptography/ed25519-dalek@69eccda yes? I'll accept a PR for that of course.

from schnorrkel.

 avatar commented on August 23, 2024

There's a problem in implementing the deserialization part, namely a BytesBuf becomes somewhat necessary if you want sequence support since Bytes doesn't implement visit_sequence, probably since the size is now known so you'd need to allocate.
I'm probably gonna impl with Bytes and if alloc is provided as feature then use ByteBuf instead

from schnorrkel.

burdges avatar burdges commented on August 23, 2024

I think a serde_bytes feature flag sounds good, mostly because ed25519-dalek did so.

from schnorrkel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.