Comments (8)
If you are building for arm64, there are no asm optimizations currently. You should define uECC_ASM to uECC_asm_none.
I will attempt to fix the automatic checking for this case.
from micro-ecc.
I can't reproduce this issue. Can you tell me which version of Xcode you are using, and how you have configured your project / build settings?
from micro-ecc.
Thanks kmackay. I'm using Xcode 6.3.1 on OS X Yosemite. I just download and import uECC.h, uECC.c and asm_arm.inc into my project. The Architecture of Build Settings is:
Architectures: Standard architectures (armv7, arm64)
Valid Architectures: arm64 armv7 armv7s
While, I just follow your advice and change "uECC_ASM to uECC_asm_none" in uECC.h, and then it won't throw any errors.
By the way, I just want to do a signature verification of secp256k1 with uECC_verify. The documents say I need to compile with "-DuECC_CURVE=uECC_secp256k1", but how can I set this in Xcode? Notes that there are other C code in my project. Any ideas of how to do a secp256k1 signature verification?
from micro-ecc.
The easiest way is to just modify uECC.h: change the line "#define uECC_CURVE uECC_secp160r1" to "#define uECC_CURVE uECC_secp256k1"
Another way to do it is to modify the preprocessor macro settings in your project build settings. I don't really use Xcode much, but here is how I did it: Go to the project build settings (go to the project settings by clicking on the project, and then go to the "Build Settings" tab). Then make sure it is showing "All" (not "Basic"). Then go to the section "Preprocessor Macros" (you can use the search bar). And add a new entry "uECC_CURVE=uECC_secp256k1" in both the debug and release sections.
from micro-ecc.
Great! Thank you so much! The easiest way works for me. By the way, my signature length is 71 bytes while uECC_verify only accepts signature length with 64 bytes. I can't find any functions to transfer the signature. Any idea about how to do it?
from micro-ecc.
I'm guessing that you are doing something Bitcoin-related, in which case your signature is DER encoded. You need to decode it to get the raw signature to pass in to uECC_verify(). See here.
from micro-ecc.
Yes, my signature is DER decoded. And for your reference, this is the raw bytes of my signature,
3045 0221 0088 9a34 54e7 f4f8 eee6 d984
a00f 73f7 d564 4d92 0e49 526c 1c30 6074
2283 1bd1 5a02 2000 c03e a953 89f8 5393
4730 4dc7 7b44 b3a7 cf4b 8114 f569 431e
6de4 d591 8a64 8b
I found that in my signature, length of R is 33 bytes and length of S is 32 bytes. They sum up to 65 bytes, still not 64 bytes. So how to decode it to 64 bytes signature correctly?
from micro-ecc.
The reason R is 33 bytes is because the highest bit is set, so there is a 0 byte prepended (to make the overall integer "positive" in a signed representation. To decode, just skip the 0 byte; in your example, I think R would start at the 0x88 byte.
from micro-ecc.
Related Issues (20)
- Arduino compatibility
- Does micro-ecc works with signature (secp256r1) where R or S is lower than 32 bytes? HOT 2
- Questions about ECDSA HOT 2
- Contact for responsible disclosure HOT 2
- Check for identity element is missing during verification
- Question about the public private key generation using secp160r1
- how to set the RNG function? HOT 2
- HASH out value differnet on same file? HOT 6
- Hard fault on cortex M0+
- With latest IAR ARM Embedded workbench version 9.32 not able to compile this code HOT 2
- Earlyclobber inline asm input registers
- easy-ecc compatability?
- secp160r1 incorrect signatures on ARM Cortex M0 HOT 2
- Expression cannot be used as a function
- Point addition of same point
- Different results on different platforms
- mbedtls_ecdh_gen_public speed dosen't improve HOT 1
- not fast enought HOT 1
- GCC + `-Wpedantic` throws warning about `__int128` HOT 1
- 16-bit Implementation (MSP430)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micro-ecc.