Coder Social home page Coder Social logo

ellipticcurvekit's Issues

Throws an error when running the sample code

let message = Message(hex: "243F6A8885A308D313198A2E03707344A4093822299F31D0082EFA98EC4E6C89"
An error occurred:
Cannot invoke initializer for type 'Message' with an argument list of type '(hex: String)'

optimization Config?

Hi~
Method processing takes a long time.

It always takes over 3 seconds to run ( restoreKeyPairFrom, verify method )
I would like to know release optimization Config info.

my Xcode build Settings.

  • Complilation Mode : wholemodule
  • SWIFT_OPTIMIZATION_LEVEL (debug) : -Onone
  • append User-Define option
    SWIFT_WHOLE_MODULE_OPTIMIZATION = YES

Do you have any more settings info?

Error with Message initialization

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?

Support for Secp521R1

Hi, I'm still using your library for my project and it works great, the the app which I'm porting from Android to iOS is communicating with a 3rd Party endpoint and in one of the recent updates they switched from Secp256K1 to Secp521R1. Do you have plans to add this curve Algo?

Get PublicKey<Secp256k1> from Data

Hi,

I'm currently porting my Android app to iOS and I stumbled across your library which seems to perfectly meet my requirements. I'm not sure if I do something wrong but I'm not able to create a public key from Data. I have created a Unit test to check if the output of some crypto functions is the same as in my Android app. Therefore I use following uncompressed public key. Below the uncompressed public key in hex representation

04F40AF135A4889436CEE52B5C73A33EC5AD0BE0952F57F4F0ED0C80B0BEDA7CA643789393A5947E9FAA3F6795C9AA09A96325DFE850BFC3F1DB62A50ABFB0FFF7

Once converted the hex string to Data I use following function calls

let decodedFromUncompressed = try AffinePoint<Secp256k1>.init(data: publicKeyBytes)
return PublicKey<Secp256k1>.init(point: decodedFromUncompressed)

This leads to an error here

Upon further investigation I saw that the call

let yData = y.as256bitLongData()

returned 0 despite the value is not 0. It seems the as256bitLongData uses internally a function called asHexStringLength64 which returns following strange hex value

0-789393A5947E9FAA3F6795C9AA09A96325DFE850BFC3F1DB62A50ABFB0FFF7

The function fills up the missing values with 0 but seems to ignore the '-' sign. Is this the root cause of the error, did I misunderstand something or is there another way to get a PublicKey from uncompressed Data?

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.