GithubHelp home page GithubHelp logo

Comments (16)

trevor-crypto avatar trevor-crypto commented on August 10, 2024 1

@fredfortier I submitted a PR. If you'd like you can test it out on my branch or wait for it to come into develop

from libsecp256k1.

fredfortier avatar fredfortier commented on August 10, 2024 1

You did it @trevor-crypto . Your branch referenced above is now working for me when compiling to my no_std target.

from libsecp256k1.

fredfortier avatar fredfortier commented on August 10, 2024

Same issue here. Here's what cargo nono says:

libsecp256k1: FAILURE
  - Did not find a #![no_std] attribute or a simple conditional attribute like #[cfg_attr(not(feature = "std"), no_std)] in the crate source. Crate most likely doesn't support no_std without changes.
log: FAILURE

from libsecp256k1.

tomusdrw avatar tomusdrw commented on August 10, 2024

bump

from libsecp256k1.

trevor-crypto avatar trevor-crypto commented on August 10, 2024

Doing some investigation because I would like to move this forward as well.

I believe the issue came from the changes in #41 which make use of allocation (Vec and Box)

Would like to know what everyone else thinks. At first glance, it does not seem possible to feature-gate behind feature = "std" because the functions are used in the generators used in build.rs

Related: #46

from libsecp256k1.

trevor-crypto avatar trevor-crypto commented on August 10, 2024

#75 should resolve this issue, which is in 0.6.0

from libsecp256k1.

samkirton avatar samkirton commented on August 10, 2024

I am experiencing this issue in 0.6.0 with:

libsecp256k1 = { version="0.6.0", default-features=false, features=["static-context"] }

std duplicate method exceptions are thrown noting:

the lang item is first defined in crate `std` (which `libsecp256k1_core` depends on)

from libsecp256k1.

trevor-crypto avatar trevor-crypto commented on August 10, 2024

@samkirton that's strange...I just tried again with static-context and could not reproduce this. Do you have another crate in your dependencies that is possibly enabling std for libsecp256k1_core?

from libsecp256k1.

samkirton avatar samkirton commented on August 10, 2024

The only other dependencies I have are:

rand = { version="0.7.3", optional = true }
sha2 = { version="0.9.5", default-features=false }

[features]
signing = ["rand", "libsecp256k1/hmac"]

where rand is turned on only for the signing feature

from libsecp256k1.

trevor-crypto avatar trevor-crypto commented on August 10, 2024

@samkirton I still can't reproduce your exact error message above, but I can reproduce a similar one when I use rand as you have in your dependencies. You might need to turn off default-features for rand if you're using no_std when the signing feature is enabled.

from libsecp256k1.

samkirton avatar samkirton commented on August 10, 2024

Signing requires hmac, which requires std, so rand is only ever used for std builds. I will try and disable default features on rand though just incase optional = true isn't working as I expected it to

from libsecp256k1.

trevor-crypto avatar trevor-crypto commented on August 10, 2024

Signing requires hmac, which requires std, so rand is only ever used for std builds.

Oh right, sorry.

from libsecp256k1.

fredfortier avatar fredfortier commented on August 10, 2024

@trevor-crypto I just tried to upgrade to 0.6.0 from 0.3.5 and getting std dependencies again. I guess it's expected based on your note above:

Signing requires hmac, which requires std, so rand is only ever used for std builds.

Does this mean that this crate no longer support signing with no_std? There must be a no_std version of hmac because 0.3.5 is depending on one.

from libsecp256k1.

fredfortier avatar fredfortier commented on August 10, 2024

I tried using the blank_with_context variants thinking that the static-context feature may have been the problem but it's not.

This dependency alone pulls in the std:

libsecp256k1 = { version = "0.6.0", default-features = false, features = [
    "hmac"
] }

It would be great (or rather necessary) to have no_std signing feature like in earlier versions. My only known option is to downgrade to 0.3.5 which I'll have to patch because some of its dependencies are no longer on crates_io.

from libsecp256k1.

fredfortier avatar fredfortier commented on August 10, 2024

I'm confused about this issue as well because cargo nono check gives the dependency above (with only the hmac feature) a clear report, but the compiler gives an std error when I use it. I'll try your branch.

from libsecp256k1.

sorpaas avatar sorpaas commented on August 10, 2024

This should be fixed now. Let me know if the error still exists.

from libsecp256k1.

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.