Commit 67e62dfe authored by duanjinfei's avatar duanjinfei

change sign

parent 63e7d5ac
...@@ -3,4 +3,4 @@ httpport = 8888 ...@@ -3,4 +3,4 @@ httpport = 8888
runmode = dev runmode = dev
autorender = false autorender = false
copyrequestbody = true copyrequestbody = true
sign_prv = "0x0e80b06d24d7543b3e2520c91d25997bcf5e0e9e6361910cea6ab268c2db3600" sign_prv = "0xe3b097b0c171e2489973a277b1546392db97e359505cd64b9b52966cb87a0f08"
\ No newline at end of file \ No newline at end of file
...@@ -27,8 +27,10 @@ func (c *LLMController) GetContainerSign() { ...@@ -27,8 +27,10 @@ func (c *LLMController) GetContainerSign() {
} }
signPrv := beego.AppConfig.String("sign_prv") signPrv := beego.AppConfig.String("sign_prv")
bridgePrv := stringToPrivateKey(signPrv) bridgePrv := stringToPrivateKey(signPrv)
hash := crypto.Keccak256Hash(bytes.NewBufferString(signData.TaskId).Bytes()) reqHash := crypto.Keccak256Hash(signData.TaskParam)
signature, err := ecdsa.SignASN1(rand.Reader, bridgePrv, hash.Bytes()) respHash := crypto.Keccak256Hash(signData.TaskResult)
signHash := crypto.Keccak256Hash(bytes.NewBufferString(signData.TaskId).Bytes(), reqHash.Bytes(), respHash.Bytes())
signature, err := ecdsa.SignASN1(rand.Reader, bridgePrv, signHash.Bytes())
if err != nil { if err != nil {
return return
} }
......
...@@ -7,10 +7,9 @@ type SignInfoRep struct { ...@@ -7,10 +7,9 @@ type SignInfoRep struct {
} }
type TaskInfo struct { type TaskInfo struct {
TaskId string `json:"task_id"` TaskId string `json:"task_id"`
TaskType string `json:"task_type"` TaskParam []byte `json:"task_param"`
ImageID string `json:"image_id"` TaskResult []byte `json:"task_result"`
ImageUri string `json:"image_uri"`
} }
type ModelInfo struct { type ModelInfo struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment