How to use the sodium-javascript.crypto_sign_detached function in sodium-javascript

To help you get started, we’ve selected a few sodium-javascript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AraiEzzra / DDKCORE / backlog / logic / transaction.js View on Github external
Transaction.prototype.sign = (keyPair, trs) => {
    const sig = Buffer.alloc(sodium.crypto_sign_BYTES);

    sodium.crypto_sign_detached(sig, self.getHash(trs), keyPair.privateKey);
    return sig.toString('hex');
};
github AraiEzzra / DDKCORE / backlog / helpers / ed.js View on Github external
ed.sign = function (hash, keyPair) {
    const sig = Buffer.alloc(sodium.crypto_sign_BYTES);
    sodium.crypto_sign_detached(sig, hash, keyPair.privateKey);
    return sig;
};
github AraiEzzra / DDKCORE / core / service / block.ts View on Github external
private sign(block, keyPair): Response {
        const blockHash = this.getHash(block);
        if (!blockHash.success) {
            return new Response({ errors: [...blockHash.errors, 'sign'] });
        }

        const sig = Buffer.alloc(sodium.crypto_sign_BYTES);
        sodium.crypto_sign_detached(sig, blockHash.data, keyPair.privateKey);
        return new Response({ data: sig.toString('hex') });
    }
github AraiEzzra / DDKCORE / src / logic / transaction.js View on Github external
Transaction.prototype.sign = function (keyPair, trs) {
    const sig = Buffer.alloc(sodium.crypto_sign_BYTES);

    sodium.crypto_sign_detached(sig, this.getHash(trs), keyPair.privateKey);
    return sig.toString('hex');
};
github AraiEzzra / DDKCORE / backlog / logic / block.js View on Github external
Block.prototype.sign = function (block, keyPair) {
    const blockHash = this.getHash(block);
    const sig = Buffer.alloc(sodium.crypto_sign_BYTES);

    sodium.crypto_sign_detached(sig, blockHash, keyPair.privateKey);
    return sig.toString('hex');
};

sodium-javascript

WIP - a pure javascript version of sodium-native

MIT
Latest version published 2 years ago

Package Health Score

54 / 100
Full package analysis

Similar packages