mirror of
https://github.com/luxfi/node.git
synced 2026-10-30 15:24:05 +00:00
The module already called itself github.com/luxfi/node while containing no node in Go: cmd/luxd was twenty-one lines that printed the size of a few types, and the Go column of the matrix measured a VM plugin. A repo that fetches the thing it claims to be has not replaced it, so the Go sources move in — 1515 files, the daemon and everything under it — and the build reaches outside this module for nothing. Rust and C++ sit beside it unchanged and are still measured against it by the differential. That is the point of one repo: the reference implementation and the two ports are the same checkout, so parity is a thing you can run rather than a thing you assert. Verified: builds, and the closure carries no lux-private — checked at build time rather than believed. The daemon starts twelve chains on a local network (P X C Q Z A B G K M F, plus D through its plugin) and reports healthy.
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package staking
|
|
|
|
import (
|
|
"crypto"
|
|
"encoding/asn1"
|
|
"fmt"
|
|
|
|
// Explicitly import for the crypto.RegisterHash init side-effects.
|
|
//
|
|
// Ref: https://github.com/golang/go/blob/go1.19.12/src/crypto/x509/x509.go#L30-L34
|
|
_ "crypto/sha256"
|
|
)
|
|
|
|
var (
|
|
// Ref: https://github.com/golang/go/blob/go1.19.12/src/crypto/x509/x509.go#L433-L452
|
|
//
|
|
// RFC 3279, 2.3 Public Key Algorithms
|
|
//
|
|
// pkcs-1 OBJECT IDENTIFIER ::== { iso(1) member-body(2) us(840)
|
|
// rsadsi(113549) pkcs(1) 1 }
|
|
//
|
|
// rsaEncryption OBJECT IDENTIFIER ::== { pkcs1-1 1 }
|
|
oidPublicKeyRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1}
|
|
// RFC 5480, 2.1.1 Unrestricted Algorithm Identifier and Parameters
|
|
//
|
|
// id-ecPublicKey OBJECT IDENTIFIER ::= {
|
|
// iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 }
|
|
oidPublicKeyECDSA = asn1.ObjectIdentifier{1, 2, 840, 10045, 2, 1}
|
|
)
|
|
|
|
func init() {
|
|
if !crypto.SHA256.Available() {
|
|
panic(fmt.Sprintf("required hash %q is not available", crypto.SHA256))
|
|
}
|
|
}
|