How to use the eddsa function from elliptic
Find comprehensive JavaScript elliptic.eddsa code examples handpicked from public code repositorys.
GitHub: XRPLF/xrpl-dev-portal
2 3 4 5 6 7 8 9 10 11
// Organize imports const assert = require("assert") const brorand = require("brorand") const BN = require("bn.js") const elliptic = require("elliptic"); const Ed25519 = elliptic.eddsa('ed25519'); const Secp256k1 = elliptic.ec('secp256k1'); const hashjs = require("hash.js"); const Sha512 = require("ripple-keypairs/dist/Sha512") const { codec, encodeAccountPublic, encodeNodePublic } = require("ripple-address-codec");
973
414
136
40 41 42 43 44 45 46 47 48 49
} }; } else if(publicKeyCose.get(COSE_KEYS.kty) === COSE_KTY.OKP){ const x = publicKeyCose.get(COSE_KEYS.x); const key = new elliptic.eddsa('ed25519'); key.keyFromPublic(x); return { verified: true,
4
19
1
1 2 3 4 5 6 7 8 9 10
import { XummService } from '../../services/xumm.service'; import { rippleEpocheTimeToUTC } from '../../utils/normalizers'; import { createHash } from 'crypto'; const elliptic = require('elliptic'); const ed25519 = new elliptic.eddsa('ed25519') const secp256k1 = new elliptic.ec('secp256k1') const codec = {
1
12
2
2 3 4 5 6 7 8 9 10 11
const { getDigestFromMultihash } = require('../utils/ipfs') class Crypto { constructor(chluIpfs){ this.chluIpfs = chluIpfs; this.ec = new elliptic.eddsa('ed25519') this.rand = brorand } async storePublicKey(pubKey) {
1
1
3
GitHub: wert-io/widget-sc-signer
5 6 7 8 9 10 11 12 13 14
'commodity_amount', 'network', 'sc_address', 'sc_input_data', ]; const ellipticEdDSA = new elliptic_1.eddsa('ed25519'); const trimHexPrefix = (str) => { if (!str) return str; if (str.substring(0, 2) === '0x') {
1
0
0
16 17 18 19 20 21 22 23 24 25 26 27 28
} const encoder = new TextEncoder(); const signed_bytes = encoder.encode(canonicalize(certificate.certificate)); // encode the string into bytes with UTF-8 encoding const result = elliptic.eddsa('ed25519').verify(signed_bytes, certificate.signature.value, signing_certificate.certificate.publicKey.key); if (result) { console.log("The signature is valid."); } else {
1
0
0
elliptic.ec is the most popular function in elliptic (164 examples)