Skip to content

Commit

Permalink
Add basic structure for crypto, state, time (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
bamzedev authored Jul 24, 2024
1 parent 30fb858 commit c775ed3
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/crypto/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package crypto

const (
HashSize = 32
BandersnatchSize = 32
Ed25519PublicSize = 32
Ed25519PrivateSize = 64
BLSSize = 144
)
3 changes: 3 additions & 0 deletions internal/crypto/hash.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package crypto

type Hash [HashSize]byte
8 changes: 8 additions & 0 deletions internal/crypto/keys.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package crypto

import (
"crypto/ed25519"
)

type Ed25519PublicKey ed25519.PublicKey
type Ed25519PrivateKey ed25519.PrivateKey
4 changes: 4 additions & 0 deletions internal/state/state.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package state

type State struct {
}
9 changes: 9 additions & 0 deletions internal/time/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package time

import "time"

const (
TimeslotsPerEpoch = 600
TimeslotDuration = 6 * time.Second
EpochDuration = TimeslotsPerEpoch * TimeslotDuration
)
3 changes: 3 additions & 0 deletions internal/time/epoch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package time

type Epoch uint32
3 changes: 3 additions & 0 deletions internal/time/timeslot.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package time

type Timeslot uint32

0 comments on commit c775ed3

Please sign in to comment.