Update wasm for js-pow-sha256
This commit is contained in:
@@ -70,10 +70,14 @@ func VerifyChallenge(in challenge.Allocation) (out challenge.VerifyChallengeOutp
|
|||||||
result := make([]byte, inline.DecodedLen(len(in.Result)))
|
result := make([]byte, inline.DecodedLen(len(in.Result)))
|
||||||
n, err := inline.Decode(result, in.Result)
|
n, err := inline.Decode(result, in.Result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
return challenge.VerifyChallengeOutputError
|
||||||
}
|
}
|
||||||
result = result[:n]
|
result = result[:n]
|
||||||
|
|
||||||
|
if len(result) < 8 {
|
||||||
|
return challenge.VerifyChallengeOutputError
|
||||||
|
}
|
||||||
|
|
||||||
// verify we used same challenge
|
// verify we used same challenge
|
||||||
if subtle.ConstantTimeCompare(result[:len(result)-8], c) != 1 {
|
if subtle.ConstantTimeCompare(result[:len(result)-8], c) != 1 {
|
||||||
return challenge.VerifyChallengeOutputFailed
|
return challenge.VerifyChallengeOutputFailed
|
||||||
|
Binary file not shown.
Reference in New Issue
Block a user