ChamHash

package
v0.0.0-...-ff7f851 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CipherHost = "auth.example.com:1234"
View Source
const SecurityParameter int = 1024

Variables

This section is empty.

Functions

func Bytes2Sha256Bytes

func Bytes2Sha256Bytes(message []byte) []byte

func BytesChamHashFromBytes

func BytesChamHashFromBytes(longbytes []byte) []byte

func BytesChamHashFromSHA256

func BytesChamHashFromSHA256(sha256Hash []byte) []byte

func ChamHashAdapt

func ChamHashAdapt(m1 []byte, m2 []byte, hash []byte) []byte

collision : H(m1).hash = H(m2).hash check : check(m1, hash1) -> true; check(m2, hash2) -> true input: m1,m2,h1 return: h2 need : m1, m2 should be sha256 bytes

func ChamHashCheck

func ChamHashCheck(message []byte, hash []byte) bool

message should be sha256 bytes

func ChamHashHash

func ChamHashHash(message []byte) []byte

return ((hashValue,randomValue,Etdcipher))

func CheckChamHashOfPrpStructure

func CheckChamHashOfPrpStructure(prpbytes []byte) bool

func CheckFilledPayload

func CheckFilledPayload(filledPayloadBytes []byte) bool

verify filledPayload With correct form and verify the signature

func EqualProposalResponsePayload

func EqualProposalResponsePayload(p1 []byte, p2 []byte) (bool, error)

equalPayload is to judge p1 and p2 with chamHashStruct in

func FillPayload

func FillPayload(PayloadBytes []byte) ([]byte, []byte)

fill payload with chamhash. return (filledPayloadBytes, hashValueOfPayload)

func FillPrpStructureWithChamHash

func FillPrpStructureWithChamHash(prpbytes []byte) ([]byte, []byte)

func GetHashOfPayloadStructure

func GetHashOfPayloadStructure(filledPaylaodBytes []byte) []byte

func GetHashOfPrpStructure

func GetHashOfPrpStructure(prpbytes []byte) []byte

this function get Hash from PrpStructure

func HashValueFromChamHashBytes

func HashValueFromChamHashBytes(chamHashBytes []byte) []byte

func MockChamHashHash

func MockChamHashHash(message []byte) []byte

func UpdatePaylaod

func UpdatePaylaod(charmHashBytes []byte, payloadBytes []byte, newpayloadBytes []byte) ([]byte, error)

while modify the payload, change the chamhash struct content. paylaod.ChamHash and newpayload.ChamHash should be empty.

func UpdateProposalResponsePayload

func UpdateProposalResponsePayload(prpbytes []byte, newprpbytes []byte, chamhashBytes []byte) ([]byte, error)

update Proposal response payload, return Changed prpBytes

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL