SharedEcc25519

ANSI-C based cross-platform elliptic eurve cryptography provider with objc api

Ecc25519

One central provider of functions Ecc25519.h Using 64bit C implementation of Curve25519 by Matthijs van Duin New Structure offers

Complete redesign based on ideas of FredericJacobs/25519 project.

Usage

Diffie Hellman

Generating a Diffie Hellman public key:

NSData * publicKeyDiffieHellman = [Ecc25519 keygen:keyPrivate];

Computing a shared secret with Diffie Hellman:

NSData * sharedSecret = [Ecc25519 curvePrivate:privateKey withPublicKey:publicKey];

Edwards

Expand a private 32byte key to 64byte by Edwards keypair signing:

NSData * privateKey = [Ecc25519 expandPrivateKey:privateKey];

Compute the public key signature of a private key:

NSData * publicKeySignature = [Ecc25519 computePublicKeySignature:keyPrivate];

Create a signature of a message or data with a private key:

NSData * signature = [Ecc25519 sign:message withPrivateKey:privateKey];

Verify a signature of a message or data with a public key:

BOOL isValid = [Ecc25519 verify:signature ofMessage:message withPublicKey:publicKey]

Installation

Add this line to your Podfile

pod 'Ecc25519', '~> version number'

Cryptographics

Curve25519 x86 - Adam Langley’s curve25519-donna

Curve25519 x64 - Matthijs van Duin, based on work by Daniel J Bernstein

Edwards25519 - Trevor Perrin - extracted from Ref 10 of ed25519 and curve25519 from supercop-20140529

Source

https://github.com/mko-x/SharedEcc25519

License

GPLv3 - copy attached and online http://www.gnu.org/licenses/gpl-3.0.html