~/bend-docscommunity

src/crypto/secp256k1.bend checks

raw source on the hub · import 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/secp256k1.bend as Secp256k1

3 imports
import Base
import ./secp256k1/ecdsa.bend as E
import ./secp256k1/schnorr.bend as Sch

Types

type Keypair source · line 39 · raw

Data

Definitions

def keypair_of source · line 42 · raw

@+seed:List<&2, U32> -> @m:Maybe<&2, List<&2, U32>> -> Maybe<&2, Keypair>

def generate_keypair source · line 47 · raw

@+seed:List<&2, U32> -> Maybe<&2, Keypair>

def word_bytes source · line 50 · raw

@+w:U32 -> @rest:List<&2, U32> -> List<&2, U32>

def random_bytes source · line 53 · raw

@n:Nat -> @acc:List<&2, U32> -> IO(List<&2, U32>)

def os_retry source · line 63 · raw

@fuel:Nat -> @m:Maybe<&2, Keypair> -> IO(Maybe<&2, Keypair>)

def generate_keypair_os source · line 78 · raw

IO(Maybe<&2, Keypair>)

32 bytes of the operating system's random source (getrandom, arc4random, crypto.getRandomValues) as the seed; a seed outside [1, n - 1] (chance 2^-128) is drawn again, up to 8 times

def public_key source · line 81 · raw

@+sk:List<&2, U32> -> @compressed:Bool -> Maybe<&2, List<&2, U32>>

def sign source · line 84 · raw

@+sk:List<&2, U32> -> @+hash:List<&2, U32> -> Maybe<&2, 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/secp256k1/ecdsa.Signature>

def compact source · line 87 · raw

@m:Maybe<&2, 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/secp256k1/ecdsa.Signature> -> Maybe<&2, List<&2, U32>>

def sign_compact source · line 92 · raw

@+sk:List<&2, U32> -> @+hash:List<&2, U32> -> Maybe<&2, List<&2, U32>>

def verify source · line 95 · raw

@+pk:List<&2, U32> -> @+hash:List<&2, U32> -> @+sig:List<&2, U32> -> Bool

def verify_strict source · line 98 · raw

@+pk:List<&2, U32> -> @+hash:List<&2, U32> -> @+sig:List<&2, U32> -> Bool

def recover source · line 101 · raw

@+hash:List<&2, U32> -> @+sig:List<&2, U32> -> Maybe<&2, List<&2, U32>>

def eth_address source · line 104 · raw

@+pk:List<&2, U32> -> Maybe<&2, List<&2, U32>>

def ecrecover source · line 107 · raw

@input:List<&2, U32> -> Maybe<&2, List<&2, U32>>

def schnorr_pubkey source · line 110 · raw

@+sk:List<&2, U32> -> Maybe<&2, List<&2, U32>>

def schnorr_sign source · line 113 · raw

@+sk:List<&2, U32> -> @+msg:List<&2, U32> -> @+aux:List<&2, U32> -> Maybe<&2, List<&2, U32>>

def schnorr_verify source · line 116 · raw

@+pk:List<&2, U32> -> @+msg:List<&2, U32> -> @+sig:List<&2, U32> -> Bool