This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def SignatureGeneration(genPoint,randomNumber,hashOfThingToSign) | |
| q = EccMultiply(genPoint,randomNumber) | |
| xRandSignPoint = q[0][0] | |
| yRandSignPoint = q[0][1] | |
| r = xRandSignPoint % $numberOfPointsInFeild; | |
| s = ((hashOfThingToSign + (r*hextodec($privKey)))*(modInverse(randomNumber,$numberOfPointsInFeild))) % $numberOfPointsInFeild | |
| return [r,s] | |
| end | |
| def SignatureVerification(s,r,hashOfThingToSign,publicKey) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def modInverse (var,n) | |
| lm = 1 | |
| hm = 0 | |
| low = var % n | |
| high = n | |
| while low > 1 do | |
| ratio = high/low | |
| nm, enew = hm-lm*ratio, high-low*ratio | |
| lm, low, hm, high = nm, enew, lm, low | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'digest' | |
| $m = 2**32 | |
| $a = 1103515245 | |
| $c = 12345 | |
| def dectobin(var) | |
| return var.to_s(2) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $provePrimeNumber = 2**256 - 2**32 - 2**9 - 2**8 - 2**7 - 2**6 - 2**4 -1 | |
| $numberOfPointsInFeild = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 | |
| $xcoordinate = 55066263022277343669578718895168534326250603453777594175500187360389116729240 | |
| $ycoordinate = 32670510020758816978083085130507043184471273380659243275938904335757337482424 | |
| $privKey = "A665A45920422F9D417E4867EFDC4FB8A04A1F3FFF1FA07E998E86F7F7A27AE3" | |
| $point = Array.new([$xcoordinate,$ycoordinate]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Web3 = require('web3') | |
| var web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:5000')) | |
| web3.eth.defaultAccount = web3.eth.accounts[0] | |
| console.log(web3.eth.accounts[0]) | |
| var ABI = [ | |
| { | |
| "constant": false, | |
| "inputs": [ | |
| { | |
| "name": "_value", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.18; | |
| contract Contract { | |
| function set(string _value) public { | |
| value = _value; | |
| } | |
| function get() public constant returns (string) { | |
| return value; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let app = require('lotion')({ | |
| genesis: './genesis.json', | |
| initialState: { messages: [] }, | |
| tendermintPort: 46657, | |
| logTendermint: true, | |
| peers: ['ws://159.122.175.154:30092','ws://184.173.1.108:30092'] | |
| }) | |
| app.use((state, tx) => { | |
| if (typeof tx.sender === 'string' && typeof tx.message === 'string') { | |
| state.messages.push({ sender: tx.sender, message: tx.message }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class config { | |
| public static baseUrl = "http://<appname>.mybluemix.net"; | |
| public constructor() { | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| name: tendermintnodeone # give any name | |
| spec: | |
| replicas: 1 | |
| template: | |
| metadata: | |
| name: tendermintnodeone | |
| labels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:carbon | |
| WORKDIR /usr/src/app | |
| COPY package*.json ./ | |
| COPY privkey0.json ./ | |
| COPY .env-node1 ./ | |
| RUN npm install | |
| COPY . . | |
| EXPOSE 30090 30092 | |
| CMD [ "node", "node1.js" ] |