2018-03-02 10:57:43 +00:00
|
|
|
# Nim Eth-keys
|
2018-02-13 18:20:27 +00:00
|
|
|
# Copyright (c) 2018 Status Research & Development GmbH
|
2018-03-02 10:57:43 +00:00
|
|
|
# Licensed under either of
|
|
|
|
#
|
|
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|
|
|
|
#
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
2018-02-13 18:20:27 +00:00
|
|
|
|
2018-02-14 18:50:36 +00:00
|
|
|
import ./private/lowlevel_types
|
|
|
|
import ttmath
|
|
|
|
|
|
|
|
export lowlevel_types, ttmath
|
2018-02-13 18:20:27 +00:00
|
|
|
|
|
|
|
type
|
|
|
|
PublicKey* = object
|
2018-02-14 15:24:29 +00:00
|
|
|
raw_key*: ByteArrayBE[64]
|
2018-02-13 18:20:27 +00:00
|
|
|
|
|
|
|
PrivateKey* = object
|
2018-02-14 15:24:29 +00:00
|
|
|
raw_key*: ByteArrayBE[32]
|
2018-02-13 18:20:27 +00:00
|
|
|
public_key*: PublicKey
|
|
|
|
|
|
|
|
BaseKey* = PrivateKey|PublicKey
|
|
|
|
|
2018-02-14 18:50:36 +00:00
|
|
|
Signature* {.packed.}= object
|
2018-02-13 18:20:27 +00:00
|
|
|
r*: UInt256
|
|
|
|
s*: UInt256
|
2018-02-14 18:50:36 +00:00
|
|
|
v*: range[0.byte .. 1.byte]
|