proofs/crypto/secp256k1/laws.bend
bend-collections-laws-crypto@1.0.0.0 · 38 lines · 3 definitions
1import Base
2import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1.bend as K
3import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/ecdsa.bend as ES
4import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/schnorr.bend as SS
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21law PublicKey.correct:
22 for +one: Nat
23 for +h1: {one == 1n : Nat}
24 for +sk: List<&2, U32>
25 for c: Bool
26 {K.public_key(sk, c) == ES.public_key(one, sk, c) : Maybe<&2, List<&2, U32>>}
27
28
29law GenerateKeypair.correct:
30 for +one: Nat
31 for +h1: {one == 1n : Nat}
32 for +seed: List<&2, U32>
33 {K.generate_keypair(seed) == K.keypair_of(seed, ES.public_key(one, seed, True{})) : Maybe<&2, K.Keypair>}
34
35
36law EthAddress.correct:
37 for +pk: List<&2, U32>
38 {K.eth_address(pk) == ES.eth_address(pk) : Maybe<&2, List<&2, U32>>}