mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-18 19:25:48 +00:00
fix linting and devdeps issues by using eslint for ripple-address-codec and removing the misc plugins used by ripple-keypairs
run 'npx lerna link convert' to hoist common devDependencies to top
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import * as elliptic from 'elliptic'
|
||||
|
||||
import Sha512 from './Sha512'
|
||||
|
||||
const secp256k1 = elliptic.ec('secp256k1')
|
||||
@@ -20,25 +21,25 @@ function deriveScalar(bytes, discrim?: number) {
|
||||
return key
|
||||
}
|
||||
}
|
||||
/* This error is practically impossible to reach.
|
||||
* The order of the curve describes the (finite) amount of points on the curve
|
||||
* https://github.com/indutny/elliptic/blob/master/lib/elliptic/curves.js#L182
|
||||
* How often will an (essentially) random number generated by Sha512 be larger than that?
|
||||
* There's 2^32 chances (the for loop) to get a number smaller than the order,
|
||||
* and it's rare that you'll even get past the first loop iteration.
|
||||
* Note that in TypeScript we actually need the throw, otherwise the function signature would be BN | undefined
|
||||
*/
|
||||
// This error is practically impossible to reach.
|
||||
// The order of the curve describes the (finite) amount of points on the curve
|
||||
// https://github.com/indutny/elliptic/blob/master/lib/elliptic/curves.js#L182
|
||||
// How often will an (essentially) random number generated by Sha512 be larger than that?
|
||||
// There's 2^32 chances (the for loop) to get a number smaller than the order,
|
||||
// and it's rare that you'll even get past the first loop iteration.
|
||||
// Note that in TypeScript we actually need the throw, otherwise the function signature would be BN | undefined
|
||||
//
|
||||
/* istanbul ignore next */
|
||||
throw new Error('impossible unicorn ;)')
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array} seed - bytes
|
||||
* @param {Object} [opts] - object
|
||||
* @param {Number} [opts.accountIndex=0] - the account number to generate
|
||||
* @param {Boolean} [opts.validator=false] - generate root key-pair,
|
||||
* @param seed - Bytes.
|
||||
* @param [opts] - Object.
|
||||
* @param [opts.accountIndex=0] - The account number to generate.
|
||||
* @param [opts.validator=false] - Generate root key-pair,
|
||||
* as used by validators.
|
||||
* @return {bn.js} - 256 bit scalar value
|
||||
* @returns {bn.js} 256 bit scalar value.
|
||||
*
|
||||
*/
|
||||
export function derivePrivateKey(
|
||||
|
||||
Reference in New Issue
Block a user