vendor: update resumable dependency
Updates resumable hash implementation to Go 1.8 equivalent. This should be a major speedup, since it includes a number of optimizations from Go 1.7. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
83f857ca12
commit
f01bcc8f62
19 changed files with 1118 additions and 98 deletions
14
vendor/github.com/stevvooe/resumable/sha512/resume.go
generated
vendored
14
vendor/github.com/stevvooe/resumable/sha512/resume.go
generated
vendored
|
@ -2,8 +2,11 @@ package sha512
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto"
|
||||
"encoding/gob"
|
||||
|
||||
"github.com/stevvooe/resumable"
|
||||
|
||||
// import to ensure that our init function runs after the standard package
|
||||
_ "crypto/sha512"
|
||||
)
|
||||
|
@ -21,7 +24,7 @@ func (d *digest) State() ([]byte, error) {
|
|||
// We encode this way so that we do not have
|
||||
// to export these fields of the digest struct.
|
||||
vals := []interface{}{
|
||||
d.h, d.x, d.nx, d.len, d.is384,
|
||||
d.h, d.x, d.nx, d.len, d.function,
|
||||
}
|
||||
|
||||
for _, val := range vals {
|
||||
|
@ -40,7 +43,7 @@ func (d *digest) Restore(state []byte) error {
|
|||
// We decode this way so that we do not have
|
||||
// to export these fields of the digest struct.
|
||||
vals := []interface{}{
|
||||
&d.h, &d.x, &d.nx, &d.len, &d.is384,
|
||||
&d.h, &d.x, &d.nx, &d.len, &d.function,
|
||||
}
|
||||
|
||||
for _, val := range vals {
|
||||
|
@ -49,5 +52,12 @@ func (d *digest) Restore(state []byte) error {
|
|||
}
|
||||
}
|
||||
|
||||
switch d.function {
|
||||
case crypto.SHA384, crypto.SHA512, crypto.SHA512_224, crypto.SHA512_256:
|
||||
break
|
||||
default:
|
||||
return resumable.ErrBadState
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue