Documentation
¶
Index ¶
- func ConvUint64(val any) (uint64, error)
- func Decrypt(priv *ecdsa.PrivateKey, pubkey *ecdsa.PublicKey, ciphertext []byte) ([]byte, error)
- func Encrypt(priv *ecdsa.PrivateKey, pubkey *ecdsa.PublicKey, plaintext []byte) ([]byte, error)
- func GetSessionID(id1 [32]byte, id2 [32]byte) [32]byte
- func ParseHexNodeID(in string) ([32]byte, error)
- func ParseNodeID(in string) ([32]byte, error)
- func RandomBytes(len int) []byte
- func ToHttpAddress(addr string) string
- type TinyEasyMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvUint64 ¶
func Decrypt ¶
Decrypt gets a hashed shared point X as secret, then sym decrypts the ciphertext using sm4 (CTR mode)
func Encrypt ¶
Encrypt gets a hashed shared point X as secret, then sym encrypts the plaintext using sm4 (CTR mode) The resulting ciphertext length is BlockSize+len(plaintext), because IV is randomly generated and included at the beginning of ciphertext
func GetSessionID ¶
GetSessionID by sha256(smaller, bigger)
func ParseHexNodeID ¶
Parse hex string without trim "0x" to node ID
func ParseNodeID ¶
Parse hex string trimed "0x" to node ID
func RandomBytes ¶
func ToHttpAddress ¶
Types ¶
type TinyEasyMap ¶
type TinyEasyMap struct {
// contains filtered or unexported fields
}
func NewEasyMap ¶
func NewEasyMap(m map[string]any) TinyEasyMap
Click to show internal directories.
Click to hide internal directories.