-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with Message initialization #12
Comments
@mobileapps23 So sorry for slow response, saw this just now... But I think I talked to you on StackOverflow? Hey what kind of data do you wanna sign/verify? There are five different initializers of init<H>(unhashed: Data, hashFunction: H) where H: HashFunction init?<H>(
unhashed: String,
encoding: String.Encoding = .default,
hashFunction: H
) where H: HashFunction and init?<H>(hashedHex: HexString, hashedBy hashFunction: H) where H: HashFunction |
@Sajjon still same issue. Can you provide code example? |
@narayanprusty look at the unit tests, e.g.: https://github.com/Sajjon/EllipticCurveKit/blob/master/Tests/EllipticCurveKitTests/CurveTests/ECDSATests.swift which also defines convenience inits:
|
Hi, quick one, is there a way to sign without hashing the message? |
@luis7lucho Sounds like you don't really know what you are doing? We ALWAYS hash stuff in crypto. Always. You cannot sign a text document being a couple of hundreds of KB or even MB. That makes no sense. We ALWAYS hash the thing we wanna sign. So either you already have a hash, then you can you the init in You can also use So sounds like you don't really know what you are signing...? Which really is what you should sort ought first. What are you signing? When you know what you are signing, why not just use the initializers I encourage you to use, e.g. Makes sense? |
Hi Sajjon, thanks for the reply. I have noticed something on your latests commits, the test and the method to generate a signature takes quite a bit of time, a bit when generating the public key but mostly generating the signature, I have put this on a background thread but wanted to know if there is a way around that? |
@luis7lucho I will be closing this issue then, since neither @mobileapps23 nor @narayanprusty have replied. @luis7lucho regarding performance, since the project is now a SPM package, the tests are no longer run with optimization flag. I have not found a way of using optimization with tests yet, I created a this StackOverflow question, but no reply yet - I'm pretty sure it is not possible yet... Hopefully soon! |
@luis7lucho please upvote the SO question, so maybe someone posts an answer, thx! |
Hello!
Your lib perfectly matches to my goals, but I have trouble with Message from your example:
let message = Message(hex: "243F6A8885A308D313198A2E03707344A4093822299F31D0082EFA98EC4E6C89" An error occurred: Cannot invoke initializer for type 'Message' with an argument list of type '(hex: String)'
How could I init Message with some String?
The text was updated successfully, but these errors were encountered: