Giter Site home page Giter Site logo

Comments (3)

rben-dev avatar rben-dev commented on May 25, 2024

Hi @GeorgeLyon,

Thanks for your interest in libecc. Have you found the reason behind this behaviour and consider the issue closed?

Regards,
Ryad

from libecc.

GeorgeLyon avatar GeorgeLyon commented on May 25, 2024

No, but I found another thread to pull on. I will reopen with new information when I do. Sorry for being undercommunicative

from libecc.

GeorgeLyon avatar GeorgeLyon commented on May 25, 2024

I found the fix, the issue was on my end but arose from a bit of confusion on the API level. Some pointer arguments to various ec_params fields (like ec_curve for prj_pt_init) are not only used for initialization, but also stored in the struct and thus must be valid for the entire duration of time that the value is in use. Normally, this isn't an issue (because when do ec_params go away?) but Swift's withUnsafePointer(to:,_:) only guarantees the validity of the pointer for the execution of the provided closure.

The local/global distinction was a red herring, since I was using the global ec_params from multiple code locations (and thus multiple invocations of withUnsafePointer(to:,_:)) but the local test happened entirely in a single invocation. The hex diff was also a red herring, since the wlen field is a single byte and any padding was free to contain junk (likely because of a Swift's interpretation of C structs) 7ffeefbfc250 and 7ffeefbf8ec8 are both actually 4 with some junk bytes on the end.

If you are interested in how I'm using this library, my code is available at https://github.com/GeorgeLyon/OPAQUE

from libecc.

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.