Code Monkey home page Code Monkey logo

swift-eris-keys's Introduction

This library is made possible by the work of the following people/teams:

The source code and accompanying files are provided under the Apache v2 license (or respective license for prior work). This framework provides generation, signing and verification capabilities of the Eris Keys (ED25519/RipeMD160) in Swift.

Version: 0.3.6

Usage: In a standard Swift Package Manager directory tree: in Package.swift:

import PackageDescription

let package = Package(
    name: "ErisKeysTest",
    dependencies: [ .Package(url: "[email protected]:katalysis/ErisKeys.git", majorVersion: 0, minor: 3),
]
)

in Sources/main.swift

import Foundation
import ErisKeys

// cryptographically secure random generated Array<UInt8> of length 32. 
let privKS: [UInt8] = [0x19,0x8C,0x02,0xC9,0xE2,0xA9,0x38,0xE8,0x55,0xF8,0x25,0xB3,0xB0,0xDB,0x06,0xD5,0xD8,0xA1,0xC5,0x2A,0xE4,0xB6,0xA2,0x93,0x4B,0x50,0xDC,0xFB,0xB0,0x89,0xE7,0x99]

let ek = ErisKey(seed: privKS)

print(ek.pubKeyStr)
print(ek.account)

let message: [UInt8] = [0xD0,0x0A,0xC3,0x26,0x76,0x6F,0x69,0x63,0x69,0x20,0x75,0x6E,0x20,0x74,0x65,0x78,0x74,0x65,0x20,0x64,0x65,0x20,0x33,0x32,0x20,0x63,0x68,0x61,0x72,0x61,0x63,0x74,0x65,0x72,0x65,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF2,0x14,0x9A,0x1E,0xC4,0x94,0xD9,0x46,0x58,0x1A,0xC4,0x53,0x21,0xA0,0xE5,0x45,0x57,0x3D,0x2C,0x4C]

let sig = ek.sign(message)

print(ek.signAsStr(message))

// Signature verification (using Ed25519.Verify(,,,))
if (Verify(ek.pubKey, message, sig)) {
  print("Signature is verified!")
}

Supported toolchain: 3.0.2 (Xcode 8.3)

Supported plaftorms:

  • macOS
  • Linux
  • iOS (Podfile)
source 'https://github.com/CocoaPods/Specs.git'
source 'https://gitlab.com/katalysis/Pods.git'

target 'ErisKeysApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  pod 'ErisKeys', '~> 0.3.6'

  target 'ErisKeysAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

swift-eris-keys's People

Contributors

ratranqu avatar

Watchers

 avatar  avatar

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.