Home Reference Source

Function

Static Public Summary
public

ECSignature(r: *, s: *)

public

HmacSHA256(buffer: *, secret: *): *

public

calcPubKeyRecoveryParam(curve: *, e: *, signature: *, Q: *): *

Calculate pubkey extraction parameter.

public

convert(type: *): *

public

deterministicGenerateK(curve: *, hash: *, d: *, checkSig: *, nonce: *): *

public

emitter(): *

public

enforce(type: *, value: *)

public

get(state: *): *

public

normalize(brainKey: *): *

public

recoverPubKey(curve: *, e: *, signature: *, i: *): *

Recover a public key from a signature.

public

ripemd160(data: *): *

public

set(state: *): *

public

sha256(data: *, encoding: *): string | Buffer

public

sha512(data: *, encoding: *): string | Buffer

public

sign(curve: *, hash: *, d: *, nonce: *): *

public

template(op: *)

Console print any transaction object with zero default values.

public

verify(curve: *, hash: *, signature: *, Q: *): *

public

verifyRaw(curve: *, e: *, signature: *, Q: *): *

Static Public

public ECSignature(r: *, s: *) source

import ECSignature from 'bitsharesjs/lib/ecc/src/ecsignature.js'

Params:

NameTypeAttributeDescription
r *
s *

public HmacSHA256(buffer: *, secret: *): * source

import {HmacSHA256} from 'bitsharesjs/lib/ecc/src/hash.js'

Params:

NameTypeAttributeDescription
buffer *
secret *

Return:

*

public calcPubKeyRecoveryParam(curve: *, e: *, signature: *, Q: *): * source

import {calcPubKeyRecoveryParam} from 'bitsharesjs/lib/ecc/src/ecdsa.js'

Calculate pubkey extraction parameter.

When extracting a pubkey from a signature, we have to distinguish four different cases. Rather than putting this burden on the verifier, Bitcoin includes a 2-bit value with the signature.

This function simply tries all four cases and returns the value that resulted in a successful pubkey recovery.

Params:

NameTypeAttributeDescription
curve *
e *
signature *
Q *

Return:

*

public convert(type: *): * source

Params:

NameTypeAttributeDescription
type *

Return:

*

public deterministicGenerateK(curve: *, hash: *, d: *, checkSig: *, nonce: *): * source

import {deterministicGenerateK} from 'bitsharesjs/lib/ecc/src/ecdsa.js'

Params:

NameTypeAttributeDescription
curve *
hash *
d *
checkSig *
nonce *

Return:

*

public emitter(): * source

Return:

*

public enforce(type: *, value: *) source

Params:

NameTypeAttributeDescription
type *
value *

public get(state: *): * source

Params:

NameTypeAttributeDescription
state *

Return:

*

public normalize(brainKey: *): * source

import normalize from 'bitsharesjs/lib/ecc/src/BrainKey.js'

Params:

NameTypeAttributeDescription
brainKey *

Return:

*

public recoverPubKey(curve: *, e: *, signature: *, i: *): * source

import {recoverPubKey} from 'bitsharesjs/lib/ecc/src/ecdsa.js'

Recover a public key from a signature.

See SEC 1: Elliptic Curve Cryptography, section 4.1.6, "Public Key Recovery Operation".

http://www.secg.org/download/aid-780/sec1-v2.pdf

Params:

NameTypeAttributeDescription
curve *
e *
signature *
i *

Return:

*

public ripemd160(data: *): * source

import {ripemd160} from 'bitsharesjs/lib/ecc/src/hash.js'

Params:

NameTypeAttributeDescription
data *

Return:

*

public set(state: *): * source

Params:

NameTypeAttributeDescription
state *

Return:

*

public sha256(data: *, encoding: *): string | Buffer source

import {sha256} from 'bitsharesjs/lib/ecc/src/hash.js'

Params:

NameTypeAttributeDescription
data *
encoding *

Return:

string | Buffer

Buffer when digest is null, or string

public sha512(data: *, encoding: *): string | Buffer source

import {sha512} from 'bitsharesjs/lib/ecc/src/hash.js'

Params:

NameTypeAttributeDescription
data *
encoding *

Return:

string | Buffer

Buffer when digest is null, or string

public sign(curve: *, hash: *, d: *, nonce: *): * source

Params:

NameTypeAttributeDescription
curve *
hash *
d *
nonce *

Return:

*

public template(op: *) source

Console print any transaction object with zero default values.

Params:

NameTypeAttributeDescription
op *

public verify(curve: *, hash: *, signature: *, Q: *): * source

import {verify} from 'bitsharesjs/lib/ecc/src/ecdsa.js'

Params:

NameTypeAttributeDescription
curve *
hash *
signature *
Q *

Return:

*

public verifyRaw(curve: *, e: *, signature: *, Q: *): * source

import {verifyRaw} from 'bitsharesjs/lib/ecc/src/ecdsa.js'

Params:

NameTypeAttributeDescription
curve *
e *
signature *
Q *

Return:

*