<p>You may want to check out <a href="https://rtyley.github.io/spongycastle/" rel="nofollow noreferrer">Spongy Castle</a>, which is the Android-specific port of <a href="https://www.bouncycastle.org/java.html" rel="nofollow noreferrer">Bouncy Castle</a>.  I've used Bouncy Castle in C# to secpk2561 functions, so I assume Spongy Castle will have what you need, although it will be Java and not C++.</p>

<p>Also check out this question on SO:  <a href="https://stackoverflow.com/questions/29778852/how-to-create-ecdsa-keypair-256bit-for-bitcoin-curve-secp256k1-using-spongy">https://stackoverflow.com/questions/29778852/how-to-create-ecdsa-keypair-256bit-for-bitcoin-curve-secp256k1-using-spongy</a></p>

CC BY-SA 3.0
2016-06-07T15:21:07.240Z
2016-06-07T15:29:16.577Z
2017-05-23T12:34:59.703Z
Jestin
<p>Maybe <a href="https://github.com/bitcoin-core/secp256k1" rel="nofollow">libsecp256k1</a>, which is what Bitcoin Core itself uses. Not sure about Android usability, but it compiles on many architectures.</p>

CC BY-SA 3.0
2016-06-07T17:04:13.170Z
Libsecp256k1 is pure C89, with optional assembly optimizations (including ARM, since very recently). It may need some tweaks to work on Android NDK, but should otherwise work fine. Feel free to report any issues around that on the issue tracker: https://github.com/bitcoin-core/secp256k1
Pieter Wuille
CC BY-SA 3.0
2016-06-07T12:57:06.120Z
2016-06-07T12:57:06.120Z
Jannes
<p>I am working on a tiny C++ bitcoin application for a university project. I'm using <a href="http://www.blockcypher.com/" rel="nofollow">Blockcypher API</a> to create transactions, but I faced a problem with signing transaction's hash that returns one of the methods. Are there any simple C++ libraries that will allow me to sign this hash with secp256k1 ECDSA? Also, library must work for Android NDK development.</p>

<p>Maybe I have found <a href="https://github.com/libbitcoin/secp256k1" rel="nofollow">one</a>, but I have a problem with installation, and I don't exactly know if I can use it with Android NDK. </p>

<p>Thanks for all answers! </p>

CC BY-SA 3.0
2016-06-07T17:01:40.223Z
That link is an older fork of libsecp256k1 with MSVC support added (see Jannes' answer)
Pieter Wuille
<development><android><c++><secp256k1>
C++ and secp256k1
Guest_User
# C++ and secp256k1

(Asked by: username_0 on 2016-06-07)

I am working on a tiny C++ bitcoin application for a university project. I'm using [Blockcypher API](http://www.blockcypher.com/) to create transactions, but I faced a problem with signing transaction's hash that returns one of the methods. Are there any simple C++ libraries that will allow me to sign this hash with secp256k1 ECDSA? Also, library must work for Android NDK development.

Maybe I have found [one](https://github.com/libbitcoin/secp256k1), but I have a problem with installation, and I don't exactly know if I can use it with Android NDK.

Thanks for all answers!

**Tags:** development, android, c++, secp256k1

> **Comments:**
> **username_1**: That link is an older fork of libsecp256k1 with MSVC support added (see username_3' answer)  

---

## 2 answers

### Answer by username_3 on 2016-06-07. Score: 3 | Accepted answer

Maybe [libsecp256k1](https://github.com/bitcoin-core/secp256k1), which is what Bitcoin Core itself uses. Not sure about Android usability, but it compiles on many architectures.

> **Comments:**
> **username_1**: Libsecp256k1 is pure C89, with optional assembly optimizations (including ARM, since very recently). It may need some tweaks to work on Android NDK, but should otherwise work fine. Feel free to report any issues around that on the issue tracker: https://github.com/bitcoin-core/secp256k1  

---

### Answer by username_2 on 2016-06-07. Score: 0

You may want to check out [Spongy Castle](https://rtyley.github.io/spongycastle/), which is the Android-specific port of [Bouncy Castle](https://www.bouncycastle.org/java.html). I've used Bouncy Castle in C# to secpk2561 functions, so I assume Spongy Castle will have what you need, although it will be Java and not C++.

Also check out this question on SO: <https://stackoverflow.com/questions/29778852/how-to-create-ecdsa-keypair-256bit-for-bitcoin-curve-secp256k1-using-spongy>


---

