Initial QSfera import
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
FROM golang:1.25@sha256:31c1e53dfc1cc2d269deec9c83f58729fa3c53dc9a576f6426109d1e319e9e9a
|
||||
|
||||
ENV GOOS=linux
|
||||
ENV GOARCH=arm
|
||||
ENV CGO_ENABLED=1
|
||||
ENV CC=arm-linux-gnueabihf-gcc
|
||||
ENV PATH="/go/bin/${GOOS}_${GOARCH}:${PATH}"
|
||||
ENV PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig
|
||||
|
||||
RUN dpkg --add-architecture armhf \
|
||||
&& apt update \
|
||||
&& apt install -y --no-install-recommends \
|
||||
gcc-arm-linux-gnueabihf \
|
||||
libc6-dev-armhf-cross \
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY . /src/workdir
|
||||
|
||||
WORKDIR /src/workdir
|
||||
|
||||
RUN go build ./...
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
FROM golang:1.25@sha256:31c1e53dfc1cc2d269deec9c83f58729fa3c53dc9a576f6426109d1e319e9e9a
|
||||
|
||||
ENV GOOS=linux
|
||||
ENV GOARCH=arm64
|
||||
ENV CGO_ENABLED=1
|
||||
ENV CC=aarch64-linux-gnu-gcc
|
||||
ENV PATH="/go/bin/${GOOS}_${GOARCH}:${PATH}"
|
||||
ENV PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
|
||||
|
||||
# install build & runtime dependencies
|
||||
RUN dpkg --add-architecture arm64 \
|
||||
&& apt update \
|
||||
&& apt install -y --no-install-recommends \
|
||||
gcc-aarch64-linux-gnu \
|
||||
libc6-dev-arm64-cross \
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY . /src/workdir
|
||||
|
||||
WORKDIR /src/workdir
|
||||
|
||||
RUN go build ./...
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2023 pjbgf
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
FUZZ_TIME ?= 1m
|
||||
|
||||
export CGO_ENABLED := 1
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
go test -race -timeout 15s ./...
|
||||
|
||||
.PHONY: bench
|
||||
bench:
|
||||
go test -benchmem -run=^$$ -bench ^Benchmark ./...
|
||||
|
||||
.PHONY: fuzz
|
||||
fuzz:
|
||||
go test -tags gofuzz -fuzz=. -fuzztime=$(FUZZ_TIME) ./test/
|
||||
|
||||
# Cross build project in arm/v7.
|
||||
build-arm:
|
||||
docker build -t sha1cd-arm -f Dockerfile.arm .
|
||||
docker run --rm sha1cd-arm
|
||||
|
||||
# Cross build project in arm64.
|
||||
build-arm64:
|
||||
docker build -t sha1cd-arm64 -f Dockerfile.arm64 .
|
||||
docker run --rm sha1cd-arm64
|
||||
|
||||
# Build with cgo disabled.
|
||||
build-nocgo:
|
||||
CGO_ENABLED=0 go build ./cgo
|
||||
|
||||
# Run cross-compilation to assure supported architectures.
|
||||
cross-build: build-arm build-arm64 build-nocgo
|
||||
|
||||
verify:
|
||||
git diff --exit-code
|
||||
go vet ./...
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
# sha1cd
|
||||
|
||||
A Go implementation of SHA1 with counter-cryptanalysis, which detects
|
||||
collision attacks.
|
||||
|
||||
The `cgo/lib` code is a carbon copy of the [original code], based on
|
||||
the award winning [white paper] by Marc Stevens.
|
||||
|
||||
The Go and native implementations are largely based off upstream Go.
|
||||
|
||||
## Usage
|
||||
|
||||
`sha1cd` can be used as a drop-in replacement for `crypto/sha1`:
|
||||
|
||||
```golang
|
||||
import "github.com/pjbgf/sha1cd"
|
||||
|
||||
func test(){
|
||||
data := []byte("data to be sha1 hashed")
|
||||
h := sha1cd.Sum(data)
|
||||
fmt.Printf("hash: %q\n", hex.EncodeToString(h))
|
||||
}
|
||||
```
|
||||
|
||||
To obtain information as to whether a collision was found, use the
|
||||
func `CollisionResistantSum`.
|
||||
|
||||
```golang
|
||||
import "github.com/pjbgf/sha1cd"
|
||||
|
||||
func test(){
|
||||
data := []byte("data to be sha1 hashed")
|
||||
h, col := sha1cd.CollisionResistantSum(data)
|
||||
if col {
|
||||
fmt.Println("collision found!")
|
||||
}
|
||||
fmt.Printf("hash: %q", hex.EncodeToString(h))
|
||||
}
|
||||
```
|
||||
|
||||
Note that the algorithm will automatically avoid collision, by
|
||||
extending the SHA1 to 240-steps, instead of 80 when a collision
|
||||
attempt is detected. Therefore, inputs that contains the unavoidable
|
||||
bit conditions will yield a different hash from `sha1cd`, when compared
|
||||
with results using `crypto/sha1`. Valid inputs will have matching the outputs.
|
||||
|
||||
## References
|
||||
- https://shattered.io/
|
||||
- https://github.com/cr-marcstevens/sha1collisiondetection
|
||||
- https://csrc.nist.gov/Projects/Cryptographic-Algorithm-Validation-Program/Secure-Hashing#shavs
|
||||
|
||||
## Use of the Original Implementation
|
||||
- https://github.com/git/git/commit/28dc98e343ca4eb370a29ceec4c19beac9b5c01e
|
||||
- https://github.com/libgit2/libgit2/pull/4136
|
||||
|
||||
[original code]: https://github.com/cr-marcstevens/sha1collisiondetection
|
||||
[white paper]: https://marc-stevens.nl/research/papers/C13-S.pdf
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package sha1cd
|
||||
|
||||
import "hash"
|
||||
|
||||
type CollisionResistantHash interface {
|
||||
// CollisionResistantSum extends on Sum by returning an additional boolean
|
||||
// which indicates whether a collision was found during the hashing process.
|
||||
CollisionResistantSum(b []byte) ([]byte, bool)
|
||||
|
||||
hash.Hash
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package shared
|
||||
|
||||
const (
|
||||
// Constants for the SHA-1 hash function.
|
||||
K0 = 0x5A827999
|
||||
K1 = 0x6ED9EBA1
|
||||
K2 = 0x8F1BBCDC
|
||||
K3 = 0xCA62C1D6
|
||||
|
||||
// Initial values for the buffer variables: h0, h1, h2, h3, h4.
|
||||
Init0 = 0x67452301
|
||||
Init1 = 0xEFCDAB89
|
||||
Init2 = 0x98BADCFE
|
||||
Init3 = 0x10325476
|
||||
Init4 = 0xC3D2E1F0
|
||||
|
||||
// Initial values for the temporary variables (ihvtmp0, ihvtmp1, ihvtmp2, ihvtmp3, ihvtmp4) during the SHA recompression step.
|
||||
InitTmp0 = 0xD5
|
||||
InitTmp1 = 0x394
|
||||
InitTmp2 = 0x8152A8
|
||||
InitTmp3 = 0x0
|
||||
InitTmp4 = 0xA7ECE0
|
||||
|
||||
// SHA1 contains 2 buffers, each based off 5 32-bit words.
|
||||
WordBuffers = 5
|
||||
|
||||
// The output of SHA1 is 20 bytes (160 bits).
|
||||
Size = 20
|
||||
|
||||
// Rounds represents the number of steps required to process each chunk.
|
||||
Rounds = 80
|
||||
|
||||
// SHA1 processes the input data in chunks. Each chunk contains 64 bytes.
|
||||
Chunk = 64
|
||||
|
||||
// The number of pre-step compression state to store.
|
||||
// Currently there are 3 pre-step compression states required: 0, 58, 65.
|
||||
PreStepState = 3
|
||||
|
||||
Magic = "shacd\x01"
|
||||
MarshaledSize = len(Magic) + 5*4 + Chunk + 8
|
||||
)
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package sha1cd implements collision detection based on the whitepaper
|
||||
// Counter-cryptanalysis from Marc Stevens. The original ubc implementation
|
||||
// was done by Marc Stevens and Dan Shumow, and can be found at:
|
||||
// https://github.com/cr-marcstevens/sha1collisiondetection
|
||||
package sha1cd
|
||||
|
||||
// This SHA1 implementation is based on Go's generic SHA1.
|
||||
// Original: https://github.com/golang/go/blob/master/src/crypto/sha1/sha1.go
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"hash"
|
||||
|
||||
shared "github.com/pjbgf/sha1cd/internal"
|
||||
)
|
||||
|
||||
// The size of a SHA-1 checksum in bytes.
|
||||
const Size = shared.Size
|
||||
|
||||
// The blocksize of SHA-1 in bytes.
|
||||
const BlockSize = shared.Chunk
|
||||
|
||||
// digest represents the partial evaluation of a checksum.
|
||||
type digest struct {
|
||||
h [shared.WordBuffers]uint32
|
||||
x [shared.Chunk]byte
|
||||
nx int
|
||||
len uint64
|
||||
|
||||
// col defines whether a collision has been found.
|
||||
col bool
|
||||
}
|
||||
|
||||
func (d *digest) MarshalBinary() ([]byte, error) {
|
||||
b := make([]byte, 0, shared.MarshaledSize)
|
||||
b = append(b, shared.Magic...)
|
||||
b = appendUint32(b, d.h[0])
|
||||
b = appendUint32(b, d.h[1])
|
||||
b = appendUint32(b, d.h[2])
|
||||
b = appendUint32(b, d.h[3])
|
||||
b = appendUint32(b, d.h[4])
|
||||
b = append(b, d.x[:d.nx]...)
|
||||
b = b[:len(b)+len(d.x)-d.nx] // already zero
|
||||
b = appendUint64(b, d.len)
|
||||
return b, nil
|
||||
}
|
||||
|
||||
func appendUint32(b []byte, v uint32) []byte {
|
||||
return append(b,
|
||||
byte(v>>24),
|
||||
byte(v>>16),
|
||||
byte(v>>8),
|
||||
byte(v),
|
||||
)
|
||||
}
|
||||
|
||||
func appendUint64(b []byte, v uint64) []byte {
|
||||
return append(b,
|
||||
byte(v>>56),
|
||||
byte(v>>48),
|
||||
byte(v>>40),
|
||||
byte(v>>32),
|
||||
byte(v>>24),
|
||||
byte(v>>16),
|
||||
byte(v>>8),
|
||||
byte(v),
|
||||
)
|
||||
}
|
||||
|
||||
func (d *digest) UnmarshalBinary(b []byte) error {
|
||||
if len(b) < len(shared.Magic) || string(b[:len(shared.Magic)]) != shared.Magic {
|
||||
return errors.New("crypto/sha1: invalid hash state identifier")
|
||||
}
|
||||
if len(b) != shared.MarshaledSize {
|
||||
return errors.New("crypto/sha1: invalid hash state size")
|
||||
}
|
||||
b = b[len(shared.Magic):]
|
||||
b, d.h[0] = consumeUint32(b)
|
||||
b, d.h[1] = consumeUint32(b)
|
||||
b, d.h[2] = consumeUint32(b)
|
||||
b, d.h[3] = consumeUint32(b)
|
||||
b, d.h[4] = consumeUint32(b)
|
||||
b = b[copy(d.x[:], b):]
|
||||
b, d.len = consumeUint64(b)
|
||||
d.nx = int(d.len % shared.Chunk)
|
||||
return nil
|
||||
}
|
||||
|
||||
func consumeUint64(b []byte) ([]byte, uint64) {
|
||||
_ = b[7]
|
||||
x := uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 |
|
||||
uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56
|
||||
return b[8:], x
|
||||
}
|
||||
|
||||
func consumeUint32(b []byte) ([]byte, uint32) {
|
||||
_ = b[3]
|
||||
x := uint32(b[3]) | uint32(b[2])<<8 | uint32(b[1])<<16 | uint32(b[0])<<24
|
||||
return b[4:], x
|
||||
}
|
||||
|
||||
func (d *digest) Reset() {
|
||||
d.h[0] = shared.Init0
|
||||
d.h[1] = shared.Init1
|
||||
d.h[2] = shared.Init2
|
||||
d.h[3] = shared.Init3
|
||||
d.h[4] = shared.Init4
|
||||
d.nx = 0
|
||||
d.len = 0
|
||||
|
||||
d.col = false
|
||||
}
|
||||
|
||||
// New returns a new hash.Hash computing the SHA1 checksum. The Hash also
|
||||
// implements encoding.BinaryMarshaler and encoding.BinaryUnmarshaler to
|
||||
// marshal and unmarshal the internal state of the hash.
|
||||
func New() hash.Hash {
|
||||
var d digest
|
||||
d.Reset()
|
||||
return &d
|
||||
}
|
||||
|
||||
func (d *digest) Size() int { return Size }
|
||||
|
||||
func (d *digest) BlockSize() int { return BlockSize }
|
||||
|
||||
func (d *digest) Write(p []byte) (nn int, err error) {
|
||||
if len(p) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
nn = len(p)
|
||||
d.len += uint64(nn)
|
||||
if d.nx > 0 {
|
||||
n := copy(d.x[d.nx:], p)
|
||||
d.nx += n
|
||||
if d.nx == shared.Chunk {
|
||||
block(d, d.x[:])
|
||||
d.nx = 0
|
||||
}
|
||||
p = p[n:]
|
||||
}
|
||||
if len(p) >= shared.Chunk {
|
||||
n := len(p) &^ (shared.Chunk - 1)
|
||||
block(d, p[:n])
|
||||
p = p[n:]
|
||||
}
|
||||
if len(p) > 0 {
|
||||
d.nx = copy(d.x[:], p)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (d *digest) Sum(in []byte) []byte {
|
||||
// Make a copy of d so that caller can keep writing and summing.
|
||||
d0 := *d
|
||||
hash := d0.checkSum()
|
||||
return append(in, hash[:]...)
|
||||
}
|
||||
|
||||
func (d *digest) checkSum() [Size]byte {
|
||||
len := d.len
|
||||
// Padding. Add a 1 bit and 0 bits until 56 bytes mod 64.
|
||||
var tmp [64 + 8]byte
|
||||
tmp[0] = 0x80
|
||||
var t uint64
|
||||
if len%64 < 56 {
|
||||
t = 56 - len%64
|
||||
} else {
|
||||
t = 64 + 56 - len%64
|
||||
}
|
||||
|
||||
// Length in bits.
|
||||
len <<= 3
|
||||
padlen := tmp[:t+8]
|
||||
binary.BigEndian.PutUint64(tmp[t:], len)
|
||||
d.Write(padlen)
|
||||
|
||||
if d.nx != 0 {
|
||||
panic("d.nx != 0")
|
||||
}
|
||||
|
||||
var digest [Size]byte
|
||||
|
||||
binary.BigEndian.PutUint32(digest[0:], d.h[0])
|
||||
binary.BigEndian.PutUint32(digest[4:], d.h[1])
|
||||
binary.BigEndian.PutUint32(digest[8:], d.h[2])
|
||||
binary.BigEndian.PutUint32(digest[12:], d.h[3])
|
||||
binary.BigEndian.PutUint32(digest[16:], d.h[4])
|
||||
|
||||
return digest
|
||||
}
|
||||
|
||||
// Sum returns the SHA-1 checksum of the data.
|
||||
func Sum(data []byte) ([Size]byte, bool) {
|
||||
var d digest
|
||||
d.Reset()
|
||||
d.Write(data)
|
||||
return d.checkSum(), d.col
|
||||
}
|
||||
|
||||
func (d *digest) CollisionResistantSum(in []byte) ([]byte, bool) {
|
||||
// Make a copy of d so that caller can keep writing and summing.
|
||||
d0 := *d
|
||||
hash := d0.checkSum()
|
||||
return append(in, hash[:]...), d0.col
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
//go:build !noasm && gc && amd64 && !arm64
|
||||
// +build !noasm,gc,amd64,!arm64
|
||||
|
||||
package sha1cd
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/klauspost/cpuid/v2"
|
||||
shared "github.com/pjbgf/sha1cd/internal"
|
||||
)
|
||||
|
||||
var hasSHANI = (runtime.GOARCH == "amd64" &&
|
||||
cpuid.CPU.Supports(cpuid.AVX) &&
|
||||
cpuid.CPU.Supports(cpuid.SHA) &&
|
||||
cpuid.CPU.Supports(cpuid.SSE3) &&
|
||||
cpuid.CPU.Supports(cpuid.SSE4))
|
||||
|
||||
// blockAMD64 hashes the message p into the current state in h.
|
||||
// Both m1 and cs are used to store intermediate results which are used by the collision detection logic.
|
||||
//
|
||||
//go:noescape
|
||||
func blockAMD64(h []uint32, p []byte, m1 []uint32, cs [][5]uint32)
|
||||
|
||||
func block(dig *digest, p []byte) {
|
||||
if forceGeneric || !hasSHANI {
|
||||
blockGeneric(dig, p)
|
||||
return
|
||||
}
|
||||
|
||||
m1 := [shared.Rounds]uint32{}
|
||||
cs := [shared.PreStepState][shared.WordBuffers]uint32{}
|
||||
|
||||
for len(p) >= shared.Chunk {
|
||||
// The assembly code only supports processing a block at a time,
|
||||
// so adjust the chunk accordingly.
|
||||
chunk := p[:shared.Chunk]
|
||||
|
||||
blockAMD64(dig.h[:], chunk, m1[:], cs[:])
|
||||
rectifyCompressionState(&m1, &cs)
|
||||
|
||||
col := checkCollision(&m1, &cs, &dig.h)
|
||||
if col {
|
||||
dig.col = true
|
||||
|
||||
blockAMD64(dig.h[:], chunk, m1[:], cs[:])
|
||||
blockAMD64(dig.h[:], chunk, m1[:], cs[:])
|
||||
}
|
||||
|
||||
p = p[shared.Chunk:]
|
||||
}
|
||||
}
|
||||
+274
@@ -0,0 +1,274 @@
|
||||
//go:build !noasm && gc && amd64 && !arm64
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
// License information for the original SHA1 arm64 implemention:
|
||||
// Copyright 2024 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found at:
|
||||
// - https://github.com/golang/go/blob/master/LICENSE
|
||||
//
|
||||
// Reference implementations:
|
||||
// - https://github.com/golang/go/blob/master/src/crypto/sha1/sha1block_amd64.s
|
||||
|
||||
// Reverse the dword order in abcd via PSHUFD then store the 16 bytes in one
|
||||
// move, instead of issuing four VPEXTRD's that each go through the store port.
|
||||
#define LOADCS(abcd, e, index, target) \
|
||||
VPSHUFD $0x1B, abcd, X8; \
|
||||
VMOVDQU X8, ((index*20)+0)(target); \
|
||||
MOVL e, ((index*20)+16)(target);
|
||||
|
||||
#define LOADM1(m1, index, target) \
|
||||
VPSHUFD $0x1B, m1, X8; \
|
||||
VMOVDQU X8, ((index*16)+0)(target);
|
||||
|
||||
// func blockAMD64(h []uint32, p []byte, m1 []uint32, cs [][5]uint32)
|
||||
// Requires: AVX, SHA, SSE2, SSE4.1, SSSE3
|
||||
TEXT ·blockAMD64(SB), NOSPLIT, $80-96
|
||||
MOVQ h_base+0(FP), DI
|
||||
MOVQ p_base+24(FP), SI
|
||||
MOVQ p_len+32(FP), DX
|
||||
MOVQ m1_base+48(FP), R13
|
||||
MOVQ cs_base+72(FP), R15
|
||||
CMPQ DX, $0x00
|
||||
JEQ done
|
||||
ADDQ SI, DX
|
||||
|
||||
// Allocate space on the stack for saving ABCD and E0, and align it to 16 bytes
|
||||
LEAQ 15(SP), AX
|
||||
MOVQ $0x000000000000000f, CX
|
||||
NOTQ CX
|
||||
ANDQ CX, AX
|
||||
|
||||
// Load initial hash state
|
||||
PINSRD $0x03, 16(DI), X5
|
||||
VMOVDQU (DI), X0
|
||||
PAND upper_mask<>+0(SB), X5
|
||||
PSHUFD $0x1b, X0, X0
|
||||
VMOVDQA shuffle_mask<>+0(SB), X7
|
||||
|
||||
loop:
|
||||
// Save ABCD and E working values
|
||||
VMOVDQA X5, (AX)
|
||||
VMOVDQA X0, 16(AX)
|
||||
|
||||
// LOAD CS 0
|
||||
VPEXTRD $3, X5, R12
|
||||
LOADCS(X0, R12, 0, R15)
|
||||
|
||||
// Rounds 0-3
|
||||
VMOVDQU (SI), X1
|
||||
PSHUFB X7, X1
|
||||
PADDD X1, X5
|
||||
VMOVDQA X0, X6
|
||||
SHA1RNDS4 $0x00, X5, X0
|
||||
LOADM1(X1, 0, R13)
|
||||
|
||||
// Rounds 4-7
|
||||
VMOVDQU 16(SI), X2
|
||||
PSHUFB X7, X2
|
||||
SHA1NEXTE X2, X6
|
||||
VMOVDQA X0, X5
|
||||
SHA1RNDS4 $0x00, X6, X0
|
||||
SHA1MSG1 X2, X1
|
||||
LOADM1(X2, 1, R13)
|
||||
|
||||
// Rounds 8-11
|
||||
VMOVDQU 32(SI), X3
|
||||
PSHUFB X7, X3
|
||||
SHA1NEXTE X3, X5
|
||||
VMOVDQA X0, X6
|
||||
SHA1RNDS4 $0x00, X5, X0
|
||||
SHA1MSG1 X3, X2
|
||||
PXOR X3, X1
|
||||
LOADM1(X3, 2, R13)
|
||||
|
||||
// Rounds 12-15
|
||||
VMOVDQU 48(SI), X4
|
||||
PSHUFB X7, X4
|
||||
SHA1NEXTE X4, X6
|
||||
VMOVDQA X0, X5
|
||||
SHA1MSG2 X4, X1
|
||||
SHA1RNDS4 $0x00, X6, X0
|
||||
SHA1MSG1 X4, X3
|
||||
PXOR X4, X2
|
||||
LOADM1(X4, 3, R13)
|
||||
|
||||
// Rounds 16-19
|
||||
SHA1NEXTE X1, X5
|
||||
VMOVDQA X0, X6
|
||||
SHA1MSG2 X1, X2
|
||||
SHA1RNDS4 $0x00, X5, X0
|
||||
SHA1MSG1 X1, X4
|
||||
PXOR X1, X3
|
||||
LOADM1(X1, 4, R13)
|
||||
|
||||
// Rounds 20-23
|
||||
SHA1NEXTE X2, X6
|
||||
VMOVDQA X0, X5
|
||||
SHA1MSG2 X2, X3
|
||||
SHA1RNDS4 $0x01, X6, X0
|
||||
SHA1MSG1 X2, X1
|
||||
PXOR X2, X4
|
||||
LOADM1(X2, 5, R13)
|
||||
|
||||
// Rounds 24-27
|
||||
SHA1NEXTE X3, X5
|
||||
VMOVDQA X0, X6
|
||||
SHA1MSG2 X3, X4
|
||||
SHA1RNDS4 $0x01, X5, X0
|
||||
SHA1MSG1 X3, X2
|
||||
PXOR X3, X1
|
||||
LOADM1(X3, 6, R13)
|
||||
|
||||
// Rounds 28-31
|
||||
SHA1NEXTE X4, X6
|
||||
VMOVDQA X0, X5
|
||||
SHA1MSG2 X4, X1
|
||||
SHA1RNDS4 $0x01, X6, X0
|
||||
SHA1MSG1 X4, X3
|
||||
PXOR X4, X2
|
||||
LOADM1(X4, 7, R13)
|
||||
|
||||
// Rounds 32-35
|
||||
SHA1NEXTE X1, X5
|
||||
VMOVDQA X0, X6
|
||||
SHA1MSG2 X1, X2
|
||||
SHA1RNDS4 $0x01, X5, X0
|
||||
SHA1MSG1 X1, X4
|
||||
PXOR X1, X3
|
||||
LOADM1(X1, 8, R13)
|
||||
|
||||
// Rounds 36-39
|
||||
SHA1NEXTE X2, X6
|
||||
VMOVDQA X0, X5
|
||||
SHA1MSG2 X2, X3
|
||||
SHA1RNDS4 $0x01, X6, X0
|
||||
SHA1MSG1 X2, X1
|
||||
PXOR X2, X4
|
||||
LOADM1(X2, 9, R13)
|
||||
|
||||
// Rounds 40-43
|
||||
SHA1NEXTE X3, X5
|
||||
VMOVDQA X0, X6
|
||||
SHA1MSG2 X3, X4
|
||||
SHA1RNDS4 $0x02, X5, X0
|
||||
SHA1MSG1 X3, X2
|
||||
PXOR X3, X1
|
||||
LOADM1(X3, 10, R13)
|
||||
|
||||
// Rounds 44-47
|
||||
SHA1NEXTE X4, X6
|
||||
VMOVDQA X0, X5
|
||||
SHA1MSG2 X4, X1
|
||||
SHA1RNDS4 $0x02, X6, X0
|
||||
SHA1MSG1 X4, X3
|
||||
PXOR X4, X2
|
||||
LOADM1(X4, 11, R13)
|
||||
|
||||
// Rounds 48-51
|
||||
SHA1NEXTE X1, X5
|
||||
VMOVDQA X0, X6
|
||||
SHA1MSG2 X1, X2
|
||||
SHA1RNDS4 $0x02, X5, X0
|
||||
VPEXTRD $0, X5, R12
|
||||
SHA1MSG1 X1, X4
|
||||
PXOR X1, X3
|
||||
LOADM1(X1, 12, R13)
|
||||
|
||||
// derive pre-round 56's E out of round 51's A.
|
||||
VPEXTRD $3, X0, R12
|
||||
ROLL $30, R12
|
||||
|
||||
// Rounds 52-55
|
||||
SHA1NEXTE X2, X6
|
||||
VMOVDQA X0, X5
|
||||
SHA1MSG2 X2, X3
|
||||
SHA1RNDS4 $0x02, X6, X0
|
||||
SHA1MSG1 X2, X1
|
||||
PXOR X2, X4
|
||||
LOADM1(X2, 13, R13)
|
||||
|
||||
// LOAD CS 58 (gathers 56 which will be rectified in Go)
|
||||
LOADCS(X0, R12, 1, R15)
|
||||
|
||||
// Rounds 56-59
|
||||
SHA1NEXTE X3, X5
|
||||
VMOVDQA X0, X6
|
||||
SHA1MSG2 X3, X4
|
||||
SHA1RNDS4 $0x02, X5, X0
|
||||
VPEXTRD $0, X5, R12
|
||||
SHA1MSG1 X3, X2
|
||||
PXOR X3, X1
|
||||
LOADM1(X3, 14, R13)
|
||||
|
||||
// derive pre-round 64's E out of round 59's A.
|
||||
VPEXTRD $3, X0, R12
|
||||
ROLL $30, R12
|
||||
|
||||
// Rounds 60-63
|
||||
SHA1NEXTE X4, X6
|
||||
VMOVDQA X0, X5
|
||||
SHA1MSG2 X4, X1
|
||||
SHA1RNDS4 $0x03, X6, X0
|
||||
SHA1MSG1 X4, X3
|
||||
PXOR X4, X2
|
||||
LOADM1(X4, 15, R13)
|
||||
|
||||
// LOAD CS 65 (gathers 64 which will be rectified in Go)
|
||||
LOADCS(X0, R12, 2, R15)
|
||||
|
||||
// Rounds 64-67
|
||||
SHA1NEXTE X1, X5
|
||||
VMOVDQA X0, X6
|
||||
SHA1MSG2 X1, X2
|
||||
SHA1RNDS4 $0x03, X5, X0
|
||||
SHA1MSG1 X1, X4
|
||||
PXOR X1, X3
|
||||
LOADM1(X1, 16, R13)
|
||||
|
||||
// Rounds 68-71
|
||||
SHA1NEXTE X2, X6
|
||||
VMOVDQA X0, X5
|
||||
SHA1MSG2 X2, X3
|
||||
SHA1RNDS4 $0x03, X6, X0
|
||||
PXOR X2, X4
|
||||
LOADM1(X2, 17, R13)
|
||||
|
||||
// Rounds 72-75
|
||||
SHA1NEXTE X3, X5
|
||||
VMOVDQA X0, X6
|
||||
SHA1MSG2 X3, X4
|
||||
SHA1RNDS4 $0x03, X5, X0
|
||||
LOADM1(X3, 18, R13)
|
||||
|
||||
// Rounds 76-79
|
||||
SHA1NEXTE X4, X6
|
||||
VMOVDQA X0, X5
|
||||
SHA1RNDS4 $0x03, X6, X0
|
||||
LOADM1(X4, 19, R13)
|
||||
|
||||
// Add saved E and ABCD
|
||||
SHA1NEXTE (AX), X5
|
||||
PADDD 16(AX), X0
|
||||
|
||||
// Check if we are done, if not return to the loop
|
||||
ADDQ $0x40, SI
|
||||
CMPQ SI, DX
|
||||
JNE loop
|
||||
|
||||
// Write the hash state back to digest
|
||||
PSHUFD $0x1b, X0, X0
|
||||
VMOVDQU X0, (DI)
|
||||
PEXTRD $0x03, X5, 16(DI)
|
||||
|
||||
done:
|
||||
RET
|
||||
|
||||
DATA upper_mask<>+0(SB)/8, $0x0000000000000000
|
||||
DATA upper_mask<>+8(SB)/8, $0xffffffff00000000
|
||||
GLOBL upper_mask<>(SB), RODATA, $16
|
||||
|
||||
DATA shuffle_mask<>+0(SB)/8, $0x08090a0b0c0d0e0f
|
||||
DATA shuffle_mask<>+8(SB)/8, $0x0001020304050607
|
||||
GLOBL shuffle_mask<>(SB), RODATA, $16
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
//go:build !noasm && gc && arm64 && !amd64
|
||||
// +build !noasm,gc,arm64,!amd64
|
||||
|
||||
package sha1cd
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/klauspost/cpuid/v2"
|
||||
shared "github.com/pjbgf/sha1cd/internal"
|
||||
)
|
||||
|
||||
var hasSHA1 = (runtime.GOARCH == "arm64" && cpuid.CPU.Supports(cpuid.SHA1))
|
||||
|
||||
// blockARM64 hashes the message p into the current state in h.
|
||||
// Both m1 and cs are used to store intermediate results which are used by the collision detection logic.
|
||||
//
|
||||
//go:noescape
|
||||
func blockARM64(h []uint32, p []byte, m1 []uint32, cs [][5]uint32)
|
||||
|
||||
func block(dig *digest, p []byte) {
|
||||
if forceGeneric || !hasSHA1 {
|
||||
blockGeneric(dig, p)
|
||||
return
|
||||
}
|
||||
|
||||
m1 := [shared.Rounds]uint32{}
|
||||
cs := [shared.PreStepState][shared.WordBuffers]uint32{}
|
||||
|
||||
for len(p) >= shared.Chunk {
|
||||
// The assembly code only supports processing a block at a time,
|
||||
// so adjust the chunk accordingly.
|
||||
chunk := p[:shared.Chunk]
|
||||
|
||||
blockARM64(dig.h[:], chunk, m1[:], cs[:])
|
||||
|
||||
rectifyCompressionState(&m1, &cs)
|
||||
col := checkCollision(&m1, &cs, &dig.h)
|
||||
if col {
|
||||
dig.col = true
|
||||
|
||||
blockARM64(dig.h[:], chunk, m1[:], cs[:])
|
||||
blockARM64(dig.h[:], chunk, m1[:], cs[:])
|
||||
}
|
||||
|
||||
p = p[shared.Chunk:]
|
||||
}
|
||||
}
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
//go:build !noasm && gc && arm64 && !amd64
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
// License information for the original SHA1 arm64 implemention:
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found at:
|
||||
// - https://github.com/golang/go/blob/master/LICENSE
|
||||
//
|
||||
// Reference implementations:
|
||||
// - https://github.com/noloader/SHA-Intrinsics/blob/master/sha1-arm.c
|
||||
// - https://github.com/golang/go/blob/master/src/crypto/sha1/sha1block_arm64.s
|
||||
|
||||
#define HASHUPDATECHOOSE \
|
||||
SHA1C V16.S4, V1, V2 \
|
||||
SHA1H V3, V1 \
|
||||
VMOV V2.B16, V3.B16
|
||||
|
||||
#define HASHUPDATEPARITY \
|
||||
SHA1P V16.S4, V1, V2 \
|
||||
SHA1H V3, V1 \
|
||||
VMOV V2.B16, V3.B16
|
||||
|
||||
#define HASHUPDATEMAJ \
|
||||
SHA1M V16.S4, V1, V2 \
|
||||
SHA1H V3, V1 \
|
||||
VMOV V2.B16, V3.B16
|
||||
|
||||
// func blockARM64(h []uint32, p []byte, m1 []uint32, cs [][5]uint32)
|
||||
TEXT ·blockARM64(SB), NOSPLIT, $80-96
|
||||
MOVD h_base+0(FP), R0
|
||||
MOVD p_base+24(FP), R1
|
||||
MOVD p_len+32(FP), R2
|
||||
MOVD m1_base+48(FP), R3
|
||||
MOVD cs_base+72(FP), R4
|
||||
|
||||
LSR $6, R2, R2
|
||||
LSL $6, R2, R2
|
||||
ADD R16, R2, R21
|
||||
|
||||
VLD1.P 16(R0), [V0.S4]
|
||||
FMOVS (R0), F20
|
||||
SUB $16, R0, R0
|
||||
|
||||
loop:
|
||||
CMP R16, R21
|
||||
BLS end
|
||||
|
||||
// Load block (p) into 16-bytes vectors.
|
||||
VLD1.P 16(R1), [V4.B16]
|
||||
VLD1.P 16(R1), [V5.B16]
|
||||
VLD1.P 16(R1), [V6.B16]
|
||||
VLD1.P 16(R1), [V7.B16]
|
||||
|
||||
// Load K constants to V19
|
||||
MOVD $·sha1Ks(SB), R22
|
||||
VLD1 (R22), [V19.S4]
|
||||
|
||||
VMOV V0.B16, V2.B16
|
||||
VMOV V20.S[0], V1
|
||||
VMOV V2.B16, V3.B16
|
||||
VDUP V19.S[0], V17.S4
|
||||
|
||||
// Little Endian
|
||||
VREV32 V4.B16, V4.B16
|
||||
VREV32 V5.B16, V5.B16
|
||||
VREV32 V6.B16, V6.B16
|
||||
VREV32 V7.B16, V7.B16
|
||||
|
||||
// LOAD M1 rounds 0-15
|
||||
VST1.P [V4.S4], (R3)
|
||||
VST1.P [V5.S4], (R3)
|
||||
VST1.P [V6.S4], (R3)
|
||||
VST1.P [V7.S4], (R3)
|
||||
|
||||
// LOAD CS 0
|
||||
VST1.P [V0.S4], (R4) // ABCD pre-round 0
|
||||
VST1.P V1.S[0], 4(R4) // E pre-round 0
|
||||
|
||||
// Rounds 0-3
|
||||
VDUP V19.S[1], V18.S4
|
||||
VADD V17.S4, V4.S4, V16.S4
|
||||
SHA1SU0 V6.S4, V5.S4, V4.S4
|
||||
HASHUPDATECHOOSE
|
||||
SHA1SU1 V7.S4, V4.S4
|
||||
|
||||
// Rounds 4-7
|
||||
VADD V17.S4, V5.S4, V16.S4
|
||||
SHA1SU0 V7.S4, V6.S4, V5.S4
|
||||
HASHUPDATECHOOSE
|
||||
SHA1SU1 V4.S4, V5.S4
|
||||
// LOAD M1 rounds 16-19
|
||||
VST1.P [V4.S4], (R3)
|
||||
|
||||
// Rounds 8-11
|
||||
VADD V17.S4, V6.S4, V16.S4
|
||||
SHA1SU0 V4.S4, V7.S4, V6.S4
|
||||
HASHUPDATECHOOSE
|
||||
SHA1SU1 V5.S4, V6.S4
|
||||
// LOAD M1 rounds 20-23
|
||||
VST1.P [V5.S4], (R3)
|
||||
|
||||
// Rounds 12-15
|
||||
VADD V17.S4, V7.S4, V16.S4
|
||||
SHA1SU0 V5.S4, V4.S4, V7.S4
|
||||
HASHUPDATECHOOSE
|
||||
SHA1SU1 V6.S4, V7.S4
|
||||
// LOAD M1 rounds 24-27
|
||||
VST1.P [V6.S4], (R3)
|
||||
|
||||
// Rounds 16-19
|
||||
VADD V17.S4, V4.S4, V16.S4
|
||||
SHA1SU0 V6.S4, V5.S4, V4.S4
|
||||
HASHUPDATECHOOSE
|
||||
SHA1SU1 V7.S4, V4.S4
|
||||
// LOAD M1 rounds 28-31
|
||||
VST1.P [V7.S4], (R3)
|
||||
|
||||
// Rounds 20-23
|
||||
VDUP V19.S[2], V17.S4
|
||||
VADD V18.S4, V5.S4, V16.S4
|
||||
SHA1SU0 V7.S4, V6.S4, V5.S4
|
||||
HASHUPDATEPARITY
|
||||
SHA1SU1 V4.S4, V5.S4
|
||||
// LOAD M1 rounds 32-35
|
||||
VST1.P [V4.S4], (R3)
|
||||
|
||||
// Rounds 24-27
|
||||
VADD V18.S4, V6.S4, V16.S4
|
||||
SHA1SU0 V4.S4, V7.S4, V6.S4
|
||||
HASHUPDATEPARITY
|
||||
SHA1SU1 V5.S4, V6.S4
|
||||
// LOAD M1 rounds 36-39
|
||||
VST1.P [V5.S4], (R3)
|
||||
|
||||
// Rounds 28-31
|
||||
VADD V18.S4, V7.S4, V16.S4
|
||||
SHA1SU0 V5.S4, V4.S4, V7.S4
|
||||
HASHUPDATEPARITY
|
||||
SHA1SU1 V6.S4, V7.S4
|
||||
// LOAD M1 rounds 40-43
|
||||
VST1.P [V6.S4], (R3)
|
||||
|
||||
// Rounds 32-35
|
||||
VADD V18.S4, V4.S4, V16.S4
|
||||
SHA1SU0 V6.S4, V5.S4, V4.S4
|
||||
HASHUPDATEPARITY
|
||||
SHA1SU1 V7.S4, V4.S4
|
||||
// LOAD M1 rounds 44-47
|
||||
VST1.P [V7.S4], (R3)
|
||||
|
||||
// Rounds 36-39
|
||||
VADD V18.S4, V5.S4, V16.S4
|
||||
SHA1SU0 V7.S4, V6.S4, V5.S4
|
||||
HASHUPDATEPARITY
|
||||
SHA1SU1 V4.S4, V5.S4
|
||||
// LOAD M1 rounds 48-51
|
||||
VST1.P [V4.S4], (R3)
|
||||
|
||||
// Rounds 44-47
|
||||
VDUP V19.S[3], V18.S4
|
||||
VADD V17.S4, V6.S4, V16.S4
|
||||
SHA1SU0 V4.S4, V7.S4, V6.S4
|
||||
HASHUPDATEMAJ
|
||||
SHA1SU1 V5.S4, V6.S4
|
||||
// LOAD M1 rounds 52-55
|
||||
VST1.P [V5.S4], (R3)
|
||||
|
||||
// Rounds 44-47
|
||||
VADD V17.S4, V7.S4, V16.S4
|
||||
SHA1SU0 V5.S4, V4.S4, V7.S4
|
||||
HASHUPDATEMAJ
|
||||
SHA1SU1 V6.S4, V7.S4
|
||||
// LOAD M1 rounds 56-59
|
||||
VST1.P [V6.S4], (R3)
|
||||
|
||||
// Rounds 48-51
|
||||
VADD V17.S4, V4.S4, V16.S4
|
||||
SHA1SU0 V6.S4, V5.S4, V4.S4
|
||||
HASHUPDATEMAJ
|
||||
SHA1SU1 V7.S4, V4.S4
|
||||
// LOAD M1 rounds 60-63
|
||||
VST1.P [V7.S4], (R3)
|
||||
|
||||
// Rounds 52-55
|
||||
VADD V17.S4, V5.S4, V16.S4
|
||||
SHA1SU0 V7.S4, V6.S4, V5.S4
|
||||
HASHUPDATEMAJ
|
||||
SHA1SU1 V4.S4, V5.S4
|
||||
|
||||
// LOAD CS 58
|
||||
VST1.P [V3.S4], (R4) // ABCD pre-round 56
|
||||
VST1.P V1.S[0], 4(R4) // E pre-round 56
|
||||
|
||||
// Rounds 56-59
|
||||
VADD V17.S4, V6.S4, V16.S4
|
||||
SHA1SU0 V4.S4, V7.S4, V6.S4
|
||||
HASHUPDATEMAJ
|
||||
SHA1SU1 V5.S4, V6.S4
|
||||
|
||||
// Rounds 60-63
|
||||
VADD V18.S4, V7.S4, V16.S4
|
||||
SHA1SU0 V5.S4, V4.S4, V7.S4
|
||||
HASHUPDATEPARITY
|
||||
SHA1SU1 V6.S4, V7.S4
|
||||
|
||||
// LOAD CS 65
|
||||
VST1.P [V3.S4], (R4) // ABCD pre-round 64
|
||||
VST1.P V1.S[0], 4(R4) // E pre-round 64
|
||||
|
||||
// Rounds 64-67
|
||||
VADD V18.S4, V4.S4, V16.S4
|
||||
HASHUPDATEPARITY
|
||||
|
||||
// LOAD M1 rounds 68-79
|
||||
VST1.P [V4.S4], (R3)
|
||||
VST1.P [V5.S4], (R3)
|
||||
VST1.P [V6.S4], (R3)
|
||||
VST1.P [V7.S4], (R3)
|
||||
|
||||
// Rounds 68-71
|
||||
VADD V18.S4, V5.S4, V16.S4
|
||||
HASHUPDATEPARITY
|
||||
|
||||
// Rounds 72-75
|
||||
VADD V18.S4, V6.S4, V16.S4
|
||||
HASHUPDATEPARITY
|
||||
|
||||
// Rounds 76-79
|
||||
VADD V18.S4, V7.S4, V16.S4
|
||||
HASHUPDATEPARITY
|
||||
|
||||
// Add working registers to hash state.
|
||||
VADD V2.S4, V0.S4, V0.S4
|
||||
VADD V1.S4, V20.S4, V20.S4
|
||||
|
||||
end:
|
||||
// Update h with final hash values.
|
||||
VST1.P [V0.S4], (R0)
|
||||
FMOVS F20, (R0)
|
||||
|
||||
RET
|
||||
|
||||
DATA ·sha1Ks+0(SB)/4, $0x5A827999 // K0
|
||||
DATA ·sha1Ks+4(SB)/4, $0x6ED9EBA1 // K1
|
||||
DATA ·sha1Ks+8(SB)/4, $0x8F1BBCDC // K2
|
||||
DATA ·sha1Ks+12(SB)/4, $0xCA62C1D6 // K3
|
||||
GLOBL ·sha1Ks(SB), RODATA, $16
|
||||
+312
@@ -0,0 +1,312 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Originally from: https://github.com/go/blob/master/src/crypto/sha1/sha1block.go
|
||||
// It has been modified to support collision detection.
|
||||
|
||||
package sha1cd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/bits"
|
||||
|
||||
shared "github.com/pjbgf/sha1cd/internal"
|
||||
"github.com/pjbgf/sha1cd/ubc"
|
||||
)
|
||||
|
||||
var forceGeneric bool
|
||||
|
||||
// blockGeneric is a portable, pure Go version of the SHA-1 block step.
|
||||
// It's used by sha1block_generic.go and tests.
|
||||
func blockGeneric(dig *digest, p []byte) {
|
||||
var w [16]uint32
|
||||
|
||||
// cs stores the pre-step compression state for only the steps required for the
|
||||
// collision detection, which are 0, 58 and 65.
|
||||
// Refer to ubc/const.go for more details.
|
||||
cs := [shared.PreStepState][shared.WordBuffers]uint32{}
|
||||
|
||||
h0, h1, h2, h3, h4 := dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4]
|
||||
for len(p) >= shared.Chunk {
|
||||
m1 := [shared.Rounds]uint32{}
|
||||
hi := 1
|
||||
|
||||
// Collision attacks are thwarted by hashing a detected near-collision block 3 times.
|
||||
// Think of it as extending SHA-1 from 80-steps to 240-steps for such blocks:
|
||||
// The best collision attacks against SHA-1 have complexity about 2^60,
|
||||
// thus for 240-steps an immediate lower-bound for the best cryptanalytic attacks would be 2^180.
|
||||
// An attacker would be better off using a generic birthday search of complexity 2^80.
|
||||
rehash:
|
||||
a, b, c, d, e := h0, h1, h2, h3, h4
|
||||
|
||||
// Each of the four 20-iteration rounds
|
||||
// differs only in the computation of f and
|
||||
// the choice of K (K0, K1, etc).
|
||||
i := 0
|
||||
|
||||
// Store pre-step compression state for the collision detection.
|
||||
cs[0] = [shared.WordBuffers]uint32{a, b, c, d, e}
|
||||
|
||||
for ; i < 16; i++ {
|
||||
// load step
|
||||
j := i * 4
|
||||
w[i] = uint32(p[j])<<24 | uint32(p[j+1])<<16 | uint32(p[j+2])<<8 | uint32(p[j+3])
|
||||
|
||||
f := b&c | (^b)&d
|
||||
t := bits.RotateLeft32(a, 5) + f + e + w[i&0xf] + shared.K0
|
||||
a, b, c, d, e = t, a, bits.RotateLeft32(b, 30), c, d
|
||||
|
||||
// Store compression state for the collision detection.
|
||||
m1[i] = w[i&0xf]
|
||||
}
|
||||
for ; i < 20; i++ {
|
||||
tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf]
|
||||
w[i&0xf] = tmp<<1 | tmp>>(32-1)
|
||||
|
||||
f := b&c | (^b)&d
|
||||
t := bits.RotateLeft32(a, 5) + f + e + w[i&0xf] + shared.K0
|
||||
a, b, c, d, e = t, a, bits.RotateLeft32(b, 30), c, d
|
||||
|
||||
// Store compression state for the collision detection.
|
||||
m1[i] = w[i&0xf]
|
||||
}
|
||||
for ; i < 40; i++ {
|
||||
tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf]
|
||||
w[i&0xf] = tmp<<1 | tmp>>(32-1)
|
||||
|
||||
f := b ^ c ^ d
|
||||
t := bits.RotateLeft32(a, 5) + f + e + w[i&0xf] + shared.K1
|
||||
a, b, c, d, e = t, a, bits.RotateLeft32(b, 30), c, d
|
||||
|
||||
// Store compression state for the collision detection.
|
||||
m1[i] = w[i&0xf]
|
||||
}
|
||||
for ; i < 60; i++ {
|
||||
if i == 58 {
|
||||
// Store pre-step compression state for the collision detection.
|
||||
cs[1] = [shared.WordBuffers]uint32{a, b, c, d, e}
|
||||
}
|
||||
|
||||
tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf]
|
||||
w[i&0xf] = tmp<<1 | tmp>>(32-1)
|
||||
|
||||
f := ((b | c) & d) | (b & c)
|
||||
t := bits.RotateLeft32(a, 5) + f + e + w[i&0xf] + shared.K2
|
||||
a, b, c, d, e = t, a, bits.RotateLeft32(b, 30), c, d
|
||||
|
||||
// Store compression state for the collision detection.
|
||||
m1[i] = w[i&0xf]
|
||||
}
|
||||
for ; i < 80; i++ {
|
||||
if i == 65 {
|
||||
// Store pre-step compression state for the collision detection.
|
||||
cs[2] = [shared.WordBuffers]uint32{a, b, c, d, e}
|
||||
}
|
||||
|
||||
tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf]
|
||||
w[i&0xf] = tmp<<1 | tmp>>(32-1)
|
||||
|
||||
f := b ^ c ^ d
|
||||
t := bits.RotateLeft32(a, 5) + f + e + w[i&0xf] + shared.K3
|
||||
a, b, c, d, e = t, a, bits.RotateLeft32(b, 30), c, d
|
||||
|
||||
// Store compression state for the collision detection.
|
||||
m1[i] = w[i&0xf]
|
||||
}
|
||||
|
||||
h0 += a
|
||||
h1 += b
|
||||
h2 += c
|
||||
h3 += d
|
||||
h4 += e
|
||||
|
||||
if hi == 2 {
|
||||
hi++
|
||||
goto rehash
|
||||
}
|
||||
|
||||
if hi == 1 {
|
||||
h := [shared.WordBuffers]uint32{h0, h1, h2, h3, h4}
|
||||
col := checkCollision(&m1, &cs, &h)
|
||||
if col {
|
||||
dig.col = true
|
||||
hi++
|
||||
goto rehash
|
||||
}
|
||||
}
|
||||
|
||||
p = p[shared.Chunk:]
|
||||
}
|
||||
|
||||
dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4] = h0, h1, h2, h3, h4
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func checkCollision(
|
||||
m1 *[shared.Rounds]uint32,
|
||||
cs *[shared.PreStepState][shared.WordBuffers]uint32,
|
||||
h *[shared.WordBuffers]uint32,
|
||||
) bool {
|
||||
if mask := ubc.CalculateDvMask(m1); mask != 0 {
|
||||
dvs := ubc.SHA1_dvs()
|
||||
|
||||
for i := 0; dvs[i].DvType != 0; i++ {
|
||||
if (mask & ((uint32)(1) << uint32(dvs[i].MaskB))) != 0 {
|
||||
var csState *[shared.WordBuffers]uint32
|
||||
switch dvs[i].TestT {
|
||||
case 58:
|
||||
csState = &cs[1]
|
||||
case 65:
|
||||
csState = &cs[2]
|
||||
case 0:
|
||||
csState = &cs[0]
|
||||
default:
|
||||
panic(fmt.Sprintf("dvs data is trying to use a testT that isn't available: %d", dvs[i].TestT))
|
||||
}
|
||||
|
||||
col := hasCollided(
|
||||
dvs[i].TestT, // testT is the step number
|
||||
// m2 is a secondary message created XORing with
|
||||
// ubc's DM prior to the SHA recompression step.
|
||||
m1, &dvs[i].Dm,
|
||||
csState,
|
||||
h)
|
||||
|
||||
if col {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func hasCollided(step uint32, m1, dm *[shared.Rounds]uint32,
|
||||
state *[shared.WordBuffers]uint32, h *[shared.WordBuffers]uint32) bool {
|
||||
// Intermediary Hash Value.
|
||||
ihv := [shared.WordBuffers]uint32{}
|
||||
|
||||
a, b, c, d, e := state[0], state[1], state[2], state[3], state[4]
|
||||
|
||||
// Walk backwards from current step to undo previous compression.
|
||||
// The existing collision detection does not have dvs higher than 65,
|
||||
// start value of i accordingly.
|
||||
for i := uint32(64); i >= 60; i-- {
|
||||
a, b, c, d, e = b, c, d, e, a
|
||||
if step > i {
|
||||
b = bits.RotateLeft32(b, -30)
|
||||
f := b ^ c ^ d
|
||||
e -= bits.RotateLeft32(a, 5) + f + shared.K3 + (m1[i] ^ dm[i]) // m2 = m1 ^ dm.
|
||||
}
|
||||
}
|
||||
for i := uint32(59); i >= 40; i-- {
|
||||
a, b, c, d, e = b, c, d, e, a
|
||||
if step > i {
|
||||
b = bits.RotateLeft32(b, -30)
|
||||
f := ((b | c) & d) | (b & c)
|
||||
e -= bits.RotateLeft32(a, 5) + f + shared.K2 + (m1[i] ^ dm[i])
|
||||
}
|
||||
}
|
||||
for i := uint32(39); i >= 20; i-- {
|
||||
a, b, c, d, e = b, c, d, e, a
|
||||
if step > i {
|
||||
b = bits.RotateLeft32(b, -30)
|
||||
f := b ^ c ^ d
|
||||
e -= bits.RotateLeft32(a, 5) + f + shared.K1 + (m1[i] ^ dm[i])
|
||||
}
|
||||
}
|
||||
for i := uint32(20); i > 0; i-- {
|
||||
j := i - 1
|
||||
a, b, c, d, e = b, c, d, e, a
|
||||
if step > j {
|
||||
b = bits.RotateLeft32(b, -30) // undo the rotate left
|
||||
f := b&c | (^b)&d
|
||||
// subtract from e
|
||||
e -= bits.RotateLeft32(a, 5) + f + shared.K0 + (m1[j] ^ dm[j])
|
||||
}
|
||||
}
|
||||
|
||||
ihv[0] = a
|
||||
ihv[1] = b
|
||||
ihv[2] = c
|
||||
ihv[3] = d
|
||||
ihv[4] = e
|
||||
a = state[0]
|
||||
b = state[1]
|
||||
c = state[2]
|
||||
d = state[3]
|
||||
e = state[4]
|
||||
|
||||
// Recompress blocks based on the current step.
|
||||
// The existing collision detection does not have dvs below 58, so they have been removed
|
||||
// from the source code. If new dvs are added which target rounds below 40, that logic
|
||||
// will need to be readded here.
|
||||
for i := uint32(40); i < 60; i++ {
|
||||
if step <= i {
|
||||
f := ((b | c) & d) | (b & c)
|
||||
t := bits.RotateLeft32(a, 5) + f + e + shared.K2 + (m1[i] ^ dm[i])
|
||||
a, b, c, d, e = t, a, bits.RotateLeft32(b, 30), c, d
|
||||
}
|
||||
}
|
||||
for i := uint32(60); i < 80; i++ {
|
||||
if step <= i {
|
||||
f := b ^ c ^ d
|
||||
t := bits.RotateLeft32(a, 5) + f + e + shared.K3 + (m1[i] ^ dm[i])
|
||||
a, b, c, d, e = t, a, bits.RotateLeft32(b, 30), c, d
|
||||
}
|
||||
}
|
||||
|
||||
ihv[0] += a
|
||||
ihv[1] += b
|
||||
ihv[2] += c
|
||||
ihv[3] += d
|
||||
ihv[4] += e
|
||||
|
||||
if ((ihv[0] ^ h[0]) | (ihv[1] ^ h[1]) |
|
||||
(ihv[2] ^ h[2]) | (ihv[3] ^ h[3]) | (ihv[4] ^ h[4])) == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// rectifyCompressionState fixes the compression state when using the
|
||||
// SIMD implementations.
|
||||
//
|
||||
// Due to the way that hardware acceleration works, the rounds
|
||||
// are executed 4 at a time. Therefore, the state for cs58 and cs65
|
||||
// are not available directly through the assembly logic. The states
|
||||
// returned are for cs56 and cs64. This function updates indexes 1 and 2
|
||||
// of cs to contain the respective CS values for rounds 58 and 65.
|
||||
//
|
||||
//go:nosplit
|
||||
func rectifyCompressionState(
|
||||
m1 *[shared.Rounds]uint32,
|
||||
cs *[shared.PreStepState][shared.WordBuffers]uint32,
|
||||
) {
|
||||
if cs == nil {
|
||||
return
|
||||
}
|
||||
|
||||
func3 := func(state [shared.WordBuffers]uint32, i int) [shared.WordBuffers]uint32 {
|
||||
a, b, c, d, e := state[0], state[1], state[2], state[3], state[4]
|
||||
|
||||
f := ((b | c) & d) | (b & c)
|
||||
t := bits.RotateLeft32(a, 5) + f + e + m1[i] + shared.K2
|
||||
a, b, c, d, e = t, a, bits.RotateLeft32(b, 30), c, d
|
||||
return [shared.WordBuffers]uint32{a, b, c, d, e}
|
||||
}
|
||||
func4 := func(state [shared.WordBuffers]uint32, i int) [shared.WordBuffers]uint32 {
|
||||
a, b, c, d, e := state[0], state[1], state[2], state[3], state[4]
|
||||
f := b ^ c ^ d
|
||||
t := bits.RotateLeft32(a, 5) + f + e + m1[i] + shared.K3
|
||||
a, b, c, d, e = t, a, bits.RotateLeft32(b, 30), c, d
|
||||
return [shared.WordBuffers]uint32{a, b, c, d, e}
|
||||
}
|
||||
|
||||
cs57 := func3(cs[1], 56)
|
||||
cs[1] = func3(cs57, 57)
|
||||
cs[2] = func4(cs[2], 64)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
//go:build (!amd64 && !arm64) || noasm
|
||||
|
||||
package sha1cd
|
||||
|
||||
func block(dig *digest, p []byte) {
|
||||
blockGeneric(dig, p)
|
||||
}
|
||||
+624
@@ -0,0 +1,624 @@
|
||||
// Based on the C implementation from Marc Stevens and Dan Shumow.
|
||||
// https://github.com/cr-marcstevens/sha1collisiondetection
|
||||
|
||||
package ubc
|
||||
|
||||
const (
|
||||
CheckSize = 80
|
||||
|
||||
DV_I_43_0_bit = (uint32)(1 << 0)
|
||||
DV_I_44_0_bit = (uint32)(1 << 1)
|
||||
DV_I_45_0_bit = (uint32)(1 << 2)
|
||||
DV_I_46_0_bit = (uint32)(1 << 3)
|
||||
DV_I_46_2_bit = (uint32)(1 << 4)
|
||||
DV_I_47_0_bit = (uint32)(1 << 5)
|
||||
DV_I_47_2_bit = (uint32)(1 << 6)
|
||||
DV_I_48_0_bit = (uint32)(1 << 7)
|
||||
DV_I_48_2_bit = (uint32)(1 << 8)
|
||||
DV_I_49_0_bit = (uint32)(1 << 9)
|
||||
DV_I_49_2_bit = (uint32)(1 << 10)
|
||||
DV_I_50_0_bit = (uint32)(1 << 11)
|
||||
DV_I_50_2_bit = (uint32)(1 << 12)
|
||||
DV_I_51_0_bit = (uint32)(1 << 13)
|
||||
DV_I_51_2_bit = (uint32)(1 << 14)
|
||||
DV_I_52_0_bit = (uint32)(1 << 15)
|
||||
DV_II_45_0_bit = (uint32)(1 << 16)
|
||||
DV_II_46_0_bit = (uint32)(1 << 17)
|
||||
DV_II_46_2_bit = (uint32)(1 << 18)
|
||||
DV_II_47_0_bit = (uint32)(1 << 19)
|
||||
DV_II_48_0_bit = (uint32)(1 << 20)
|
||||
DV_II_49_0_bit = (uint32)(1 << 21)
|
||||
DV_II_49_2_bit = (uint32)(1 << 22)
|
||||
DV_II_50_0_bit = (uint32)(1 << 23)
|
||||
DV_II_50_2_bit = (uint32)(1 << 24)
|
||||
DV_II_51_0_bit = (uint32)(1 << 25)
|
||||
DV_II_51_2_bit = (uint32)(1 << 26)
|
||||
DV_II_52_0_bit = (uint32)(1 << 27)
|
||||
DV_II_53_0_bit = (uint32)(1 << 28)
|
||||
DV_II_54_0_bit = (uint32)(1 << 29)
|
||||
DV_II_55_0_bit = (uint32)(1 << 30)
|
||||
DV_II_56_0_bit = (uint32)(1 << 31)
|
||||
)
|
||||
|
||||
// sha1_dvs contains a list of SHA-1 Disturbance Vectors (DV) which defines the
|
||||
// unavoidable bit conditions when a collision attack is in progress.
|
||||
var sha1_dvs = []DvInfo{
|
||||
{
|
||||
DvType: 1, DvK: 43, DvB: 0, TestT: 58, MaskI: 0, MaskB: 0,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x08000000, 0x9800000c, 0xd8000010, 0x08000010, 0xb8000010, 0x98000000, 0x60000000,
|
||||
0x00000008, 0xc0000000, 0x90000014, 0x10000010, 0xb8000014, 0x28000000, 0x20000010,
|
||||
0x48000000, 0x08000018, 0x60000000, 0x90000010, 0xf0000010, 0x90000008, 0xc0000000,
|
||||
0x90000010, 0xf0000010, 0xb0000008, 0x40000000, 0x90000000, 0xf0000010, 0x90000018,
|
||||
0x60000000, 0x90000010, 0x90000010, 0x90000000, 0x80000000, 0x00000010, 0xa0000000,
|
||||
0x20000000, 0xa0000000, 0x20000010, 0x00000000, 0x20000010, 0x20000000, 0x00000010,
|
||||
0x20000000, 0x00000010, 0xa0000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000001, 0x00000020, 0x00000001, 0x40000002, 0x40000040,
|
||||
0x40000002, 0x80000004, 0x80000080, 0x80000006, 0x00000049, 0x00000103, 0x80000009,
|
||||
0x80000012, 0x80000202, 0x00000018, 0x00000164, 0x00000408, 0x800000e6, 0x8000004c,
|
||||
0x00000803, 0x80000161, 0x80000599},
|
||||
}, {
|
||||
DvType: 1, DvK: 44, DvB: 0, TestT: 58, MaskI: 0, MaskB: 1,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xb4000008, 0x08000000, 0x9800000c, 0xd8000010, 0x08000010, 0xb8000010, 0x98000000,
|
||||
0x60000000, 0x00000008, 0xc0000000, 0x90000014, 0x10000010, 0xb8000014, 0x28000000,
|
||||
0x20000010, 0x48000000, 0x08000018, 0x60000000, 0x90000010, 0xf0000010, 0x90000008,
|
||||
0xc0000000, 0x90000010, 0xf0000010, 0xb0000008, 0x40000000, 0x90000000, 0xf0000010,
|
||||
0x90000018, 0x60000000, 0x90000010, 0x90000010, 0x90000000, 0x80000000, 0x00000010,
|
||||
0xa0000000, 0x20000000, 0xa0000000, 0x20000010, 0x00000000, 0x20000010, 0x20000000,
|
||||
0x00000010, 0x20000000, 0x00000010, 0xa0000000, 0x00000000, 0x20000000, 0x20000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000020, 0x00000001, 0x40000002,
|
||||
0x40000040, 0x40000002, 0x80000004, 0x80000080, 0x80000006, 0x00000049, 0x00000103,
|
||||
0x80000009, 0x80000012, 0x80000202, 0x00000018, 0x00000164, 0x00000408, 0x800000e6,
|
||||
0x8000004c, 0x00000803, 0x80000161},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 45, DvB: 0, TestT: 58, MaskI: 0, MaskB: 2,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xf4000014, 0xb4000008, 0x08000000, 0x9800000c, 0xd8000010, 0x08000010, 0xb8000010,
|
||||
0x98000000, 0x60000000, 0x00000008, 0xc0000000, 0x90000014, 0x10000010, 0xb8000014,
|
||||
0x28000000, 0x20000010, 0x48000000, 0x08000018, 0x60000000, 0x90000010, 0xf0000010,
|
||||
0x90000008, 0xc0000000, 0x90000010, 0xf0000010, 0xb0000008, 0x40000000, 0x90000000,
|
||||
0xf0000010, 0x90000018, 0x60000000, 0x90000010, 0x90000010, 0x90000000, 0x80000000,
|
||||
0x00000010, 0xa0000000, 0x20000000, 0xa0000000, 0x20000010, 0x00000000, 0x20000010,
|
||||
0x20000000, 0x00000010, 0x20000000, 0x00000010, 0xa0000000, 0x00000000, 0x20000000,
|
||||
0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000020, 0x00000001,
|
||||
0x40000002, 0x40000040, 0x40000002, 0x80000004, 0x80000080, 0x80000006, 0x00000049,
|
||||
0x00000103, 0x80000009, 0x80000012, 0x80000202, 0x00000018, 0x00000164, 0x00000408,
|
||||
0x800000e6, 0x8000004c, 0x00000803},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 46, DvB: 0, TestT: 58, MaskI: 0, MaskB: 3,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x2c000010, 0xf4000014, 0xb4000008, 0x08000000, 0x9800000c, 0xd8000010, 0x08000010,
|
||||
0xb8000010, 0x98000000, 0x60000000, 0x00000008, 0xc0000000, 0x90000014, 0x10000010,
|
||||
0xb8000014, 0x28000000, 0x20000010, 0x48000000, 0x08000018, 0x60000000, 0x90000010,
|
||||
0xf0000010, 0x90000008, 0xc0000000, 0x90000010, 0xf0000010, 0xb0000008, 0x40000000,
|
||||
0x90000000, 0xf0000010, 0x90000018, 0x60000000, 0x90000010, 0x90000010, 0x90000000,
|
||||
0x80000000, 0x00000010, 0xa0000000, 0x20000000, 0xa0000000, 0x20000010, 0x00000000,
|
||||
0x20000010, 0x20000000, 0x00000010, 0x20000000, 0x00000010, 0xa0000000, 0x00000000,
|
||||
0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000020,
|
||||
0x00000001, 0x40000002, 0x40000040, 0x40000002, 0x80000004, 0x80000080, 0x80000006,
|
||||
0x00000049, 0x00000103, 0x80000009, 0x80000012, 0x80000202, 0x00000018, 0x00000164,
|
||||
0x00000408, 0x800000e6, 0x8000004c},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 46, DvB: 2, TestT: 58, MaskI: 0, MaskB: 4,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xb0000040, 0xd0000053, 0xd0000022, 0x20000000, 0x60000032, 0x60000043,
|
||||
0x20000040, 0xe0000042, 0x60000002, 0x80000001, 0x00000020, 0x00000003,
|
||||
0x40000052, 0x40000040, 0xe0000052, 0xa0000000, 0x80000040, 0x20000001,
|
||||
0x20000060, 0x80000001, 0x40000042, 0xc0000043, 0x40000022, 0x00000003,
|
||||
0x40000042, 0xc0000043, 0xc0000022, 0x00000001, 0x40000002, 0xc0000043,
|
||||
0x40000062, 0x80000001, 0x40000042, 0x40000042, 0x40000002, 0x00000002,
|
||||
0x00000040, 0x80000002, 0x80000000, 0x80000002, 0x80000040, 0x00000000,
|
||||
0x80000040, 0x80000000, 0x00000040, 0x80000000, 0x00000040, 0x80000002,
|
||||
0x00000000, 0x80000000, 0x80000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000004, 0x00000080, 0x00000004, 0x00000009, 0x00000101,
|
||||
0x00000009, 0x00000012, 0x00000202, 0x0000001a, 0x00000124, 0x0000040c,
|
||||
0x00000026, 0x0000004a, 0x0000080a, 0x00000060, 0x00000590, 0x00001020,
|
||||
0x0000039a, 0x00000132},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 47, DvB: 0, TestT: 58, MaskI: 0, MaskB: 5,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xc8000010, 0x2c000010, 0xf4000014, 0xb4000008, 0x08000000, 0x9800000c,
|
||||
0xd8000010, 0x08000010, 0xb8000010, 0x98000000, 0x60000000, 0x00000008,
|
||||
0xc0000000, 0x90000014, 0x10000010, 0xb8000014, 0x28000000, 0x20000010,
|
||||
0x48000000, 0x08000018, 0x60000000, 0x90000010, 0xf0000010, 0x90000008,
|
||||
0xc0000000, 0x90000010, 0xf0000010, 0xb0000008, 0x40000000, 0x90000000,
|
||||
0xf0000010, 0x90000018, 0x60000000, 0x90000010, 0x90000010, 0x90000000,
|
||||
0x80000000, 0x00000010, 0xa0000000, 0x20000000, 0xa0000000, 0x20000010,
|
||||
0x00000000, 0x20000010, 0x20000000, 0x00000010, 0x20000000, 0x00000010,
|
||||
0xa0000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000001, 0x00000020, 0x00000001, 0x40000002,
|
||||
0x40000040, 0x40000002, 0x80000004, 0x80000080, 0x80000006, 0x00000049,
|
||||
0x00000103, 0x80000009, 0x80000012, 0x80000202, 0x00000018, 0x00000164,
|
||||
0x00000408, 0x800000e6},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 47, DvB: 2, TestT: 58, MaskI: 0, MaskB: 6,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x20000043, 0xb0000040, 0xd0000053, 0xd0000022, 0x20000000, 0x60000032,
|
||||
0x60000043, 0x20000040, 0xe0000042, 0x60000002, 0x80000001, 0x00000020,
|
||||
0x00000003, 0x40000052, 0x40000040, 0xe0000052, 0xa0000000, 0x80000040,
|
||||
0x20000001, 0x20000060, 0x80000001, 0x40000042, 0xc0000043, 0x40000022,
|
||||
0x00000003, 0x40000042, 0xc0000043, 0xc0000022, 0x00000001, 0x40000002,
|
||||
0xc0000043, 0x40000062, 0x80000001, 0x40000042, 0x40000042, 0x40000002,
|
||||
0x00000002, 0x00000040, 0x80000002, 0x80000000, 0x80000002, 0x80000040,
|
||||
0x00000000, 0x80000040, 0x80000000, 0x00000040, 0x80000000, 0x00000040,
|
||||
0x80000002, 0x00000000, 0x80000000, 0x80000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000004, 0x00000080, 0x00000004, 0x00000009,
|
||||
0x00000101, 0x00000009, 0x00000012, 0x00000202, 0x0000001a, 0x00000124,
|
||||
0x0000040c, 0x00000026, 0x0000004a, 0x0000080a, 0x00000060, 0x00000590,
|
||||
0x00001020, 0x0000039a,
|
||||
},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 48, DvB: 0, TestT: 58, MaskI: 0, MaskB: 7,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xb800000a, 0xc8000010, 0x2c000010, 0xf4000014, 0xb4000008, 0x08000000,
|
||||
0x9800000c, 0xd8000010, 0x08000010, 0xb8000010, 0x98000000, 0x60000000,
|
||||
0x00000008, 0xc0000000, 0x90000014, 0x10000010, 0xb8000014, 0x28000000,
|
||||
0x20000010, 0x48000000, 0x08000018, 0x60000000, 0x90000010, 0xf0000010,
|
||||
0x90000008, 0xc0000000, 0x90000010, 0xf0000010, 0xb0000008, 0x40000000,
|
||||
0x90000000, 0xf0000010, 0x90000018, 0x60000000, 0x90000010, 0x90000010,
|
||||
0x90000000, 0x80000000, 0x00000010, 0xa0000000, 0x20000000, 0xa0000000,
|
||||
0x20000010, 0x00000000, 0x20000010, 0x20000000, 0x00000010, 0x20000000,
|
||||
0x00000010, 0xa0000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000020, 0x00000001,
|
||||
0x40000002, 0x40000040, 0x40000002, 0x80000004, 0x80000080, 0x80000006,
|
||||
0x00000049, 0x00000103, 0x80000009, 0x80000012, 0x80000202, 0x00000018,
|
||||
0x00000164, 0x00000408,
|
||||
},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 48, DvB: 2, TestT: 58, MaskI: 0, MaskB: 8,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xe000002a, 0x20000043, 0xb0000040, 0xd0000053, 0xd0000022, 0x20000000,
|
||||
0x60000032, 0x60000043, 0x20000040, 0xe0000042, 0x60000002, 0x80000001,
|
||||
0x00000020, 0x00000003, 0x40000052, 0x40000040, 0xe0000052, 0xa0000000,
|
||||
0x80000040, 0x20000001, 0x20000060, 0x80000001, 0x40000042, 0xc0000043,
|
||||
0x40000022, 0x00000003, 0x40000042, 0xc0000043, 0xc0000022, 0x00000001,
|
||||
0x40000002, 0xc0000043, 0x40000062, 0x80000001, 0x40000042, 0x40000042,
|
||||
0x40000002, 0x00000002, 0x00000040, 0x80000002, 0x80000000, 0x80000002,
|
||||
0x80000040, 0x00000000, 0x80000040, 0x80000000, 0x00000040, 0x80000000,
|
||||
0x00000040, 0x80000002, 0x00000000, 0x80000000, 0x80000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000080, 0x00000004,
|
||||
0x00000009, 0x00000101, 0x00000009, 0x00000012, 0x00000202, 0x0000001a,
|
||||
0x00000124, 0x0000040c, 0x00000026, 0x0000004a, 0x0000080a, 0x00000060,
|
||||
0x00000590, 0x00001020},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 49, DvB: 0, TestT: 58, MaskI: 0, MaskB: 9,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x18000000, 0xb800000a, 0xc8000010, 0x2c000010, 0xf4000014, 0xb4000008,
|
||||
0x08000000, 0x9800000c, 0xd8000010, 0x08000010, 0xb8000010, 0x98000000,
|
||||
0x60000000, 0x00000008, 0xc0000000, 0x90000014, 0x10000010, 0xb8000014,
|
||||
0x28000000, 0x20000010, 0x48000000, 0x08000018, 0x60000000, 0x90000010,
|
||||
0xf0000010, 0x90000008, 0xc0000000, 0x90000010, 0xf0000010, 0xb0000008,
|
||||
0x40000000, 0x90000000, 0xf0000010, 0x90000018, 0x60000000, 0x90000010,
|
||||
0x90000010, 0x90000000, 0x80000000, 0x00000010, 0xa0000000, 0x20000000,
|
||||
0xa0000000, 0x20000010, 0x00000000, 0x20000010, 0x20000000, 0x00000010,
|
||||
0x20000000, 0x00000010, 0xa0000000, 0x00000000, 0x20000000, 0x20000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000020,
|
||||
0x00000001, 0x40000002, 0x40000040, 0x40000002, 0x80000004, 0x80000080,
|
||||
0x80000006, 0x00000049, 0x00000103, 0x80000009, 0x80000012, 0x80000202,
|
||||
0x00000018, 0x00000164},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 49, DvB: 2, TestT: 58, MaskI: 0, MaskB: 10,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x60000000, 0xe000002a, 0x20000043, 0xb0000040, 0xd0000053, 0xd0000022,
|
||||
0x20000000, 0x60000032, 0x60000043, 0x20000040, 0xe0000042, 0x60000002,
|
||||
0x80000001, 0x00000020, 0x00000003, 0x40000052, 0x40000040, 0xe0000052,
|
||||
0xa0000000, 0x80000040, 0x20000001, 0x20000060, 0x80000001, 0x40000042,
|
||||
0xc0000043, 0x40000022, 0x00000003, 0x40000042, 0xc0000043, 0xc0000022,
|
||||
0x00000001, 0x40000002, 0xc0000043, 0x40000062, 0x80000001, 0x40000042,
|
||||
0x40000042, 0x40000002, 0x00000002, 0x00000040, 0x80000002, 0x80000000,
|
||||
0x80000002, 0x80000040, 0x00000000, 0x80000040, 0x80000000, 0x00000040,
|
||||
0x80000000, 0x00000040, 0x80000002, 0x00000000, 0x80000000, 0x80000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000080,
|
||||
0x00000004, 0x00000009, 0x00000101, 0x00000009, 0x00000012, 0x00000202,
|
||||
0x0000001a, 0x00000124, 0x0000040c, 0x00000026, 0x0000004a, 0x0000080a,
|
||||
0x00000060, 0x00000590},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 50, DvB: 0, TestT: 65, MaskI: 0, MaskB: 11,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x0800000c, 0x18000000, 0xb800000a, 0xc8000010, 0x2c000010, 0xf4000014,
|
||||
0xb4000008, 0x08000000, 0x9800000c, 0xd8000010, 0x08000010, 0xb8000010,
|
||||
0x98000000, 0x60000000, 0x00000008, 0xc0000000, 0x90000014, 0x10000010,
|
||||
0xb8000014, 0x28000000, 0x20000010, 0x48000000, 0x08000018, 0x60000000,
|
||||
0x90000010, 0xf0000010, 0x90000008, 0xc0000000, 0x90000010, 0xf0000010,
|
||||
0xb0000008, 0x40000000, 0x90000000, 0xf0000010, 0x90000018, 0x60000000,
|
||||
0x90000010, 0x90000010, 0x90000000, 0x80000000, 0x00000010, 0xa0000000,
|
||||
0x20000000, 0xa0000000, 0x20000010, 0x00000000, 0x20000010, 0x20000000,
|
||||
0x00000010, 0x20000000, 0x00000010, 0xa0000000, 0x00000000, 0x20000000,
|
||||
0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
|
||||
0x00000020, 0x00000001, 0x40000002, 0x40000040, 0x40000002, 0x80000004,
|
||||
0x80000080, 0x80000006, 0x00000049, 0x00000103, 0x80000009, 0x80000012,
|
||||
0x80000202, 0x00000018,
|
||||
},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 50, DvB: 2, TestT: 65, MaskI: 0, MaskB: 12,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x20000030, 0x60000000, 0xe000002a, 0x20000043, 0xb0000040, 0xd0000053,
|
||||
0xd0000022, 0x20000000, 0x60000032, 0x60000043, 0x20000040, 0xe0000042,
|
||||
0x60000002, 0x80000001, 0x00000020, 0x00000003, 0x40000052, 0x40000040,
|
||||
0xe0000052, 0xa0000000, 0x80000040, 0x20000001, 0x20000060, 0x80000001,
|
||||
0x40000042, 0xc0000043, 0x40000022, 0x00000003, 0x40000042, 0xc0000043,
|
||||
0xc0000022, 0x00000001, 0x40000002, 0xc0000043, 0x40000062, 0x80000001,
|
||||
0x40000042, 0x40000042, 0x40000002, 0x00000002, 0x00000040, 0x80000002,
|
||||
0x80000000, 0x80000002, 0x80000040, 0x00000000, 0x80000040, 0x80000000,
|
||||
0x00000040, 0x80000000, 0x00000040, 0x80000002, 0x00000000, 0x80000000,
|
||||
0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
|
||||
0x00000080, 0x00000004, 0x00000009, 0x00000101, 0x00000009, 0x00000012,
|
||||
0x00000202, 0x0000001a, 0x00000124, 0x0000040c, 0x00000026, 0x0000004a,
|
||||
0x0000080a, 0x00000060},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 51, DvB: 0, TestT: 65, MaskI: 0, MaskB: 13,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xe8000000, 0x0800000c, 0x18000000, 0xb800000a, 0xc8000010, 0x2c000010,
|
||||
0xf4000014, 0xb4000008, 0x08000000, 0x9800000c, 0xd8000010, 0x08000010,
|
||||
0xb8000010, 0x98000000, 0x60000000, 0x00000008, 0xc0000000, 0x90000014,
|
||||
0x10000010, 0xb8000014, 0x28000000, 0x20000010, 0x48000000, 0x08000018,
|
||||
0x60000000, 0x90000010, 0xf0000010, 0x90000008, 0xc0000000, 0x90000010,
|
||||
0xf0000010, 0xb0000008, 0x40000000, 0x90000000, 0xf0000010, 0x90000018,
|
||||
0x60000000, 0x90000010, 0x90000010, 0x90000000, 0x80000000, 0x00000010,
|
||||
0xa0000000, 0x20000000, 0xa0000000, 0x20000010, 0x00000000, 0x20000010,
|
||||
0x20000000, 0x00000010, 0x20000000, 0x00000010, 0xa0000000, 0x00000000,
|
||||
0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000001, 0x00000020, 0x00000001, 0x40000002, 0x40000040, 0x40000002,
|
||||
0x80000004, 0x80000080, 0x80000006, 0x00000049, 0x00000103, 0x80000009,
|
||||
0x80000012, 0x80000202},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 51, DvB: 2, TestT: 65, MaskI: 0, MaskB: 14,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xa0000003, 0x20000030, 0x60000000, 0xe000002a, 0x20000043, 0xb0000040,
|
||||
0xd0000053, 0xd0000022, 0x20000000, 0x60000032, 0x60000043, 0x20000040,
|
||||
0xe0000042, 0x60000002, 0x80000001, 0x00000020, 0x00000003, 0x40000052,
|
||||
0x40000040, 0xe0000052, 0xa0000000, 0x80000040, 0x20000001, 0x20000060,
|
||||
0x80000001, 0x40000042, 0xc0000043, 0x40000022, 0x00000003, 0x40000042,
|
||||
0xc0000043, 0xc0000022, 0x00000001, 0x40000002, 0xc0000043, 0x40000062,
|
||||
0x80000001, 0x40000042, 0x40000042, 0x40000002, 0x00000002, 0x00000040,
|
||||
0x80000002, 0x80000000, 0x80000002, 0x80000040, 0x00000000, 0x80000040,
|
||||
0x80000000, 0x00000040, 0x80000000, 0x00000040, 0x80000002, 0x00000000,
|
||||
0x80000000, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000004, 0x00000080, 0x00000004, 0x00000009, 0x00000101, 0x00000009,
|
||||
0x00000012, 0x00000202, 0x0000001a, 0x00000124, 0x0000040c, 0x00000026,
|
||||
0x0000004a, 0x0000080a},
|
||||
},
|
||||
{
|
||||
DvType: 1, DvK: 52, DvB: 0, TestT: 65, MaskI: 0, MaskB: 15,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x04000010, 0xe8000000, 0x0800000c, 0x18000000, 0xb800000a, 0xc8000010,
|
||||
0x2c000010, 0xf4000014, 0xb4000008, 0x08000000, 0x9800000c, 0xd8000010,
|
||||
0x08000010, 0xb8000010, 0x98000000, 0x60000000, 0x00000008, 0xc0000000,
|
||||
0x90000014, 0x10000010, 0xb8000014, 0x28000000, 0x20000010, 0x48000000,
|
||||
0x08000018, 0x60000000, 0x90000010, 0xf0000010, 0x90000008, 0xc0000000,
|
||||
0x90000010, 0xf0000010, 0xb0000008, 0x40000000, 0x90000000, 0xf0000010,
|
||||
0x90000018, 0x60000000, 0x90000010, 0x90000010, 0x90000000, 0x80000000,
|
||||
0x00000010, 0xa0000000, 0x20000000, 0xa0000000, 0x20000010, 0x00000000,
|
||||
0x20000010, 0x20000000, 0x00000010, 0x20000000, 0x00000010, 0xa0000000,
|
||||
0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000001, 0x00000020, 0x00000001, 0x40000002, 0x40000040,
|
||||
0x40000002, 0x80000004, 0x80000080, 0x80000006, 0x00000049, 0x00000103,
|
||||
0x80000009, 0x80000012},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 45, DvB: 0, TestT: 58, MaskI: 0, MaskB: 16,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xec000014, 0x0c000002, 0xc0000010, 0xb400001c, 0x2c000004, 0xbc000018,
|
||||
0xb0000010, 0x0000000c, 0xb8000010, 0x08000018, 0x78000010, 0x08000014,
|
||||
0x70000010, 0xb800001c, 0xe8000000, 0xb0000004, 0x58000010, 0xb000000c,
|
||||
0x48000000, 0xb0000000, 0xb8000010, 0x98000010, 0xa0000000, 0x00000000,
|
||||
0x00000000, 0x20000000, 0x80000000, 0x00000010, 0x00000000, 0x20000010,
|
||||
0x20000000, 0x00000010, 0x60000000, 0x00000018, 0xe0000000, 0x90000000,
|
||||
0x30000010, 0xb0000000, 0x20000000, 0x20000000, 0xa0000000, 0x00000010,
|
||||
0x80000000, 0x20000000, 0x20000000, 0x20000000, 0x80000000, 0x00000010,
|
||||
0x00000000, 0x20000010, 0xa0000000, 0x00000000, 0x20000000, 0x20000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000001, 0x00000020, 0x00000001, 0x40000002, 0x40000041, 0x40000022,
|
||||
0x80000005, 0xc0000082, 0xc0000046, 0x4000004b, 0x80000107, 0x00000089,
|
||||
0x00000014, 0x8000024b, 0x0000011b, 0x8000016d, 0x8000041a, 0x000002e4,
|
||||
0x80000054, 0x00000967},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 46, DvB: 0, TestT: 58, MaskI: 0, MaskB: 17,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x2400001c, 0xec000014, 0x0c000002, 0xc0000010, 0xb400001c, 0x2c000004,
|
||||
0xbc000018, 0xb0000010, 0x0000000c, 0xb8000010, 0x08000018, 0x78000010,
|
||||
0x08000014, 0x70000010, 0xb800001c, 0xe8000000, 0xb0000004, 0x58000010,
|
||||
0xb000000c, 0x48000000, 0xb0000000, 0xb8000010, 0x98000010, 0xa0000000,
|
||||
0x00000000, 0x00000000, 0x20000000, 0x80000000, 0x00000010, 0x00000000,
|
||||
0x20000010, 0x20000000, 0x00000010, 0x60000000, 0x00000018, 0xe0000000,
|
||||
0x90000000, 0x30000010, 0xb0000000, 0x20000000, 0x20000000, 0xa0000000,
|
||||
0x00000010, 0x80000000, 0x20000000, 0x20000000, 0x20000000, 0x80000000,
|
||||
0x00000010, 0x00000000, 0x20000010, 0xa0000000, 0x00000000, 0x20000000,
|
||||
0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000001, 0x00000020, 0x00000001, 0x40000002, 0x40000041,
|
||||
0x40000022, 0x80000005, 0xc0000082, 0xc0000046, 0x4000004b, 0x80000107,
|
||||
0x00000089, 0x00000014, 0x8000024b, 0x0000011b, 0x8000016d, 0x8000041a,
|
||||
0x000002e4, 0x80000054},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 46, DvB: 2, TestT: 58, MaskI: 0, MaskB: 18,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x90000070, 0xb0000053, 0x30000008, 0x00000043, 0xd0000072, 0xb0000010,
|
||||
0xf0000062, 0xc0000042, 0x00000030, 0xe0000042, 0x20000060, 0xe0000041,
|
||||
0x20000050, 0xc0000041, 0xe0000072, 0xa0000003, 0xc0000012, 0x60000041,
|
||||
0xc0000032, 0x20000001, 0xc0000002, 0xe0000042, 0x60000042, 0x80000002,
|
||||
0x00000000, 0x00000000, 0x80000000, 0x00000002, 0x00000040, 0x00000000,
|
||||
0x80000040, 0x80000000, 0x00000040, 0x80000001, 0x00000060, 0x80000003,
|
||||
0x40000002, 0xc0000040, 0xc0000002, 0x80000000, 0x80000000, 0x80000002,
|
||||
0x00000040, 0x00000002, 0x80000000, 0x80000000, 0x80000000, 0x00000002,
|
||||
0x00000040, 0x00000000, 0x80000040, 0x80000002, 0x00000000, 0x80000000,
|
||||
0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000004, 0x00000080, 0x00000004, 0x00000009, 0x00000105,
|
||||
0x00000089, 0x00000016, 0x0000020b, 0x0000011b, 0x0000012d, 0x0000041e,
|
||||
0x00000224, 0x00000050, 0x0000092e, 0x0000046c, 0x000005b6, 0x0000106a,
|
||||
0x00000b90, 0x00000152},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 47, DvB: 0, TestT: 58, MaskI: 0, MaskB: 19,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x20000010, 0x2400001c, 0xec000014, 0x0c000002, 0xc0000010, 0xb400001c,
|
||||
0x2c000004, 0xbc000018, 0xb0000010, 0x0000000c, 0xb8000010, 0x08000018,
|
||||
0x78000010, 0x08000014, 0x70000010, 0xb800001c, 0xe8000000, 0xb0000004,
|
||||
0x58000010, 0xb000000c, 0x48000000, 0xb0000000, 0xb8000010, 0x98000010,
|
||||
0xa0000000, 0x00000000, 0x00000000, 0x20000000, 0x80000000, 0x00000010,
|
||||
0x00000000, 0x20000010, 0x20000000, 0x00000010, 0x60000000, 0x00000018,
|
||||
0xe0000000, 0x90000000, 0x30000010, 0xb0000000, 0x20000000, 0x20000000,
|
||||
0xa0000000, 0x00000010, 0x80000000, 0x20000000, 0x20000000, 0x20000000,
|
||||
0x80000000, 0x00000010, 0x00000000, 0x20000010, 0xa0000000, 0x00000000,
|
||||
0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000001, 0x00000020, 0x00000001, 0x40000002,
|
||||
0x40000041, 0x40000022, 0x80000005, 0xc0000082, 0xc0000046, 0x4000004b,
|
||||
0x80000107, 0x00000089, 0x00000014, 0x8000024b, 0x0000011b, 0x8000016d,
|
||||
0x8000041a, 0x000002e4},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 48, DvB: 0, TestT: 58, MaskI: 0, MaskB: 20,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xbc00001a, 0x20000010, 0x2400001c, 0xec000014, 0x0c000002, 0xc0000010,
|
||||
0xb400001c, 0x2c000004, 0xbc000018, 0xb0000010, 0x0000000c, 0xb8000010,
|
||||
0x08000018, 0x78000010, 0x08000014, 0x70000010, 0xb800001c, 0xe8000000,
|
||||
0xb0000004, 0x58000010, 0xb000000c, 0x48000000, 0xb0000000, 0xb8000010,
|
||||
0x98000010, 0xa0000000, 0x00000000, 0x00000000, 0x20000000, 0x80000000,
|
||||
0x00000010, 0x00000000, 0x20000010, 0x20000000, 0x00000010, 0x60000000,
|
||||
0x00000018, 0xe0000000, 0x90000000, 0x30000010, 0xb0000000, 0x20000000,
|
||||
0x20000000, 0xa0000000, 0x00000010, 0x80000000, 0x20000000, 0x20000000,
|
||||
0x20000000, 0x80000000, 0x00000010, 0x00000000, 0x20000010, 0xa0000000,
|
||||
0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000020, 0x00000001,
|
||||
0x40000002, 0x40000041, 0x40000022, 0x80000005, 0xc0000082, 0xc0000046,
|
||||
0x4000004b, 0x80000107, 0x00000089, 0x00000014, 0x8000024b, 0x0000011b,
|
||||
0x8000016d, 0x8000041a},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 49, DvB: 0, TestT: 58, MaskI: 0, MaskB: 21,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x3c000004, 0xbc00001a, 0x20000010, 0x2400001c, 0xec000014, 0x0c000002,
|
||||
0xc0000010, 0xb400001c, 0x2c000004, 0xbc000018, 0xb0000010, 0x0000000c,
|
||||
0xb8000010, 0x08000018, 0x78000010, 0x08000014, 0x70000010, 0xb800001c,
|
||||
0xe8000000, 0xb0000004, 0x58000010, 0xb000000c, 0x48000000, 0xb0000000,
|
||||
0xb8000010, 0x98000010, 0xa0000000, 0x00000000, 0x00000000, 0x20000000,
|
||||
0x80000000, 0x00000010, 0x00000000, 0x20000010, 0x20000000, 0x00000010,
|
||||
0x60000000, 0x00000018, 0xe0000000, 0x90000000, 0x30000010, 0xb0000000,
|
||||
0x20000000, 0x20000000, 0xa0000000, 0x00000010, 0x80000000, 0x20000000,
|
||||
0x20000000, 0x20000000, 0x80000000, 0x00000010, 0x00000000, 0x20000010,
|
||||
0xa0000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000020,
|
||||
0x00000001, 0x40000002, 0x40000041, 0x40000022, 0x80000005, 0xc0000082,
|
||||
0xc0000046, 0x4000004b, 0x80000107, 0x00000089, 0x00000014, 0x8000024b,
|
||||
0x0000011b, 0x8000016d},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 49, DvB: 2, TestT: 58, MaskI: 0, MaskB: 22,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xf0000010, 0xf000006a, 0x80000040, 0x90000070, 0xb0000053, 0x30000008,
|
||||
0x00000043, 0xd0000072, 0xb0000010, 0xf0000062, 0xc0000042, 0x00000030,
|
||||
0xe0000042, 0x20000060, 0xe0000041, 0x20000050, 0xc0000041, 0xe0000072,
|
||||
0xa0000003, 0xc0000012, 0x60000041, 0xc0000032, 0x20000001, 0xc0000002,
|
||||
0xe0000042, 0x60000042, 0x80000002, 0x00000000, 0x00000000, 0x80000000,
|
||||
0x00000002, 0x00000040, 0x00000000, 0x80000040, 0x80000000, 0x00000040,
|
||||
0x80000001, 0x00000060, 0x80000003, 0x40000002, 0xc0000040, 0xc0000002,
|
||||
0x80000000, 0x80000000, 0x80000002, 0x00000040, 0x00000002, 0x80000000,
|
||||
0x80000000, 0x80000000, 0x00000002, 0x00000040, 0x00000000, 0x80000040,
|
||||
0x80000002, 0x00000000, 0x80000000, 0x80000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000080,
|
||||
0x00000004, 0x00000009, 0x00000105, 0x00000089, 0x00000016, 0x0000020b,
|
||||
0x0000011b, 0x0000012d, 0x0000041e, 0x00000224, 0x00000050, 0x0000092e,
|
||||
0x0000046c, 0x000005b6},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 50, DvB: 0, TestT: 65, MaskI: 0, MaskB: 23,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xb400001c, 0x3c000004, 0xbc00001a, 0x20000010, 0x2400001c, 0xec000014,
|
||||
0x0c000002, 0xc0000010, 0xb400001c, 0x2c000004, 0xbc000018, 0xb0000010,
|
||||
0x0000000c, 0xb8000010, 0x08000018, 0x78000010, 0x08000014, 0x70000010,
|
||||
0xb800001c, 0xe8000000, 0xb0000004, 0x58000010, 0xb000000c, 0x48000000,
|
||||
0xb0000000, 0xb8000010, 0x98000010, 0xa0000000, 0x00000000, 0x00000000,
|
||||
0x20000000, 0x80000000, 0x00000010, 0x00000000, 0x20000010, 0x20000000,
|
||||
0x00000010, 0x60000000, 0x00000018, 0xe0000000, 0x90000000, 0x30000010,
|
||||
0xb0000000, 0x20000000, 0x20000000, 0xa0000000, 0x00000010, 0x80000000,
|
||||
0x20000000, 0x20000000, 0x20000000, 0x80000000, 0x00000010, 0x00000000,
|
||||
0x20000010, 0xa0000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
|
||||
0x00000020, 0x00000001, 0x40000002, 0x40000041, 0x40000022, 0x80000005,
|
||||
0xc0000082, 0xc0000046, 0x4000004b, 0x80000107, 0x00000089, 0x00000014,
|
||||
0x8000024b, 0x0000011b},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 50, DvB: 2, TestT: 65, MaskI: 0, MaskB: 24,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xd0000072, 0xf0000010, 0xf000006a, 0x80000040, 0x90000070, 0xb0000053,
|
||||
0x30000008, 0x00000043, 0xd0000072, 0xb0000010, 0xf0000062, 0xc0000042,
|
||||
0x00000030, 0xe0000042, 0x20000060, 0xe0000041, 0x20000050, 0xc0000041,
|
||||
0xe0000072, 0xa0000003, 0xc0000012, 0x60000041, 0xc0000032, 0x20000001,
|
||||
0xc0000002, 0xe0000042, 0x60000042, 0x80000002, 0x00000000, 0x00000000,
|
||||
0x80000000, 0x00000002, 0x00000040, 0x00000000, 0x80000040, 0x80000000,
|
||||
0x00000040, 0x80000001, 0x00000060, 0x80000003, 0x40000002, 0xc0000040,
|
||||
0xc0000002, 0x80000000, 0x80000000, 0x80000002, 0x00000040, 0x00000002,
|
||||
0x80000000, 0x80000000, 0x80000000, 0x00000002, 0x00000040, 0x00000000,
|
||||
0x80000040, 0x80000002, 0x00000000, 0x80000000, 0x80000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
|
||||
0x00000080, 0x00000004, 0x00000009, 0x00000105, 0x00000089, 0x00000016,
|
||||
0x0000020b, 0x0000011b, 0x0000012d, 0x0000041e, 0x00000224, 0x00000050,
|
||||
0x0000092e, 0x0000046c},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 51, DvB: 0, TestT: 65, MaskI: 0, MaskB: 25,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xc0000010, 0xb400001c, 0x3c000004, 0xbc00001a, 0x20000010, 0x2400001c,
|
||||
0xec000014, 0x0c000002, 0xc0000010, 0xb400001c, 0x2c000004, 0xbc000018,
|
||||
0xb0000010, 0x0000000c, 0xb8000010, 0x08000018, 0x78000010, 0x08000014,
|
||||
0x70000010, 0xb800001c, 0xe8000000, 0xb0000004, 0x58000010, 0xb000000c,
|
||||
0x48000000, 0xb0000000, 0xb8000010, 0x98000010, 0xa0000000, 0x00000000,
|
||||
0x00000000, 0x20000000, 0x80000000, 0x00000010, 0x00000000, 0x20000010,
|
||||
0x20000000, 0x00000010, 0x60000000, 0x00000018, 0xe0000000, 0x90000000,
|
||||
0x30000010, 0xb0000000, 0x20000000, 0x20000000, 0xa0000000, 0x00000010,
|
||||
0x80000000, 0x20000000, 0x20000000, 0x20000000, 0x80000000, 0x00000010,
|
||||
0x00000000, 0x20000010, 0xa0000000, 0x00000000, 0x20000000, 0x20000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000001, 0x00000020, 0x00000001, 0x40000002, 0x40000041, 0x40000022,
|
||||
0x80000005, 0xc0000082, 0xc0000046, 0x4000004b, 0x80000107, 0x00000089,
|
||||
0x00000014, 0x8000024b},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 51, DvB: 2, TestT: 65, MaskI: 0, MaskB: 26,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x00000043, 0xd0000072, 0xf0000010, 0xf000006a, 0x80000040, 0x90000070,
|
||||
0xb0000053, 0x30000008, 0x00000043, 0xd0000072, 0xb0000010, 0xf0000062,
|
||||
0xc0000042, 0x00000030, 0xe0000042, 0x20000060, 0xe0000041, 0x20000050,
|
||||
0xc0000041, 0xe0000072, 0xa0000003, 0xc0000012, 0x60000041, 0xc0000032,
|
||||
0x20000001, 0xc0000002, 0xe0000042, 0x60000042, 0x80000002, 0x00000000,
|
||||
0x00000000, 0x80000000, 0x00000002, 0x00000040, 0x00000000, 0x80000040,
|
||||
0x80000000, 0x00000040, 0x80000001, 0x00000060, 0x80000003, 0x40000002,
|
||||
0xc0000040, 0xc0000002, 0x80000000, 0x80000000, 0x80000002, 0x00000040,
|
||||
0x00000002, 0x80000000, 0x80000000, 0x80000000, 0x00000002, 0x00000040,
|
||||
0x00000000, 0x80000040, 0x80000002, 0x00000000, 0x80000000, 0x80000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000004, 0x00000080, 0x00000004, 0x00000009, 0x00000105, 0x00000089,
|
||||
0x00000016, 0x0000020b, 0x0000011b, 0x0000012d, 0x0000041e, 0x00000224,
|
||||
0x00000050, 0x0000092e},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 52, DvB: 0, TestT: 65, MaskI: 0, MaskB: 27,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x0c000002, 0xc0000010, 0xb400001c, 0x3c000004, 0xbc00001a, 0x20000010,
|
||||
0x2400001c, 0xec000014, 0x0c000002, 0xc0000010, 0xb400001c, 0x2c000004,
|
||||
0xbc000018, 0xb0000010, 0x0000000c, 0xb8000010, 0x08000018, 0x78000010,
|
||||
0x08000014, 0x70000010, 0xb800001c, 0xe8000000, 0xb0000004, 0x58000010,
|
||||
0xb000000c, 0x48000000, 0xb0000000, 0xb8000010, 0x98000010, 0xa0000000,
|
||||
0x00000000, 0x00000000, 0x20000000, 0x80000000, 0x00000010, 0x00000000,
|
||||
0x20000010, 0x20000000, 0x00000010, 0x60000000, 0x00000018, 0xe0000000,
|
||||
0x90000000, 0x30000010, 0xb0000000, 0x20000000, 0x20000000, 0xa0000000,
|
||||
0x00000010, 0x80000000, 0x20000000, 0x20000000, 0x20000000, 0x80000000,
|
||||
0x00000010, 0x00000000, 0x20000010, 0xa0000000, 0x00000000, 0x20000000,
|
||||
0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000001, 0x00000020, 0x00000001, 0x40000002, 0x40000041,
|
||||
0x40000022, 0x80000005, 0xc0000082, 0xc0000046, 0x4000004b, 0x80000107,
|
||||
0x00000089, 0x00000014},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 53, DvB: 0, TestT: 65, MaskI: 0, MaskB: 28,
|
||||
Dm: [CheckSize]uint32{
|
||||
0xcc000014, 0x0c000002, 0xc0000010, 0xb400001c, 0x3c000004, 0xbc00001a,
|
||||
0x20000010, 0x2400001c, 0xec000014, 0x0c000002, 0xc0000010, 0xb400001c,
|
||||
0x2c000004, 0xbc000018, 0xb0000010, 0x0000000c, 0xb8000010, 0x08000018,
|
||||
0x78000010, 0x08000014, 0x70000010, 0xb800001c, 0xe8000000, 0xb0000004,
|
||||
0x58000010, 0xb000000c, 0x48000000, 0xb0000000, 0xb8000010, 0x98000010,
|
||||
0xa0000000, 0x00000000, 0x00000000, 0x20000000, 0x80000000, 0x00000010,
|
||||
0x00000000, 0x20000010, 0x20000000, 0x00000010, 0x60000000, 0x00000018,
|
||||
0xe0000000, 0x90000000, 0x30000010, 0xb0000000, 0x20000000, 0x20000000,
|
||||
0xa0000000, 0x00000010, 0x80000000, 0x20000000, 0x20000000, 0x20000000,
|
||||
0x80000000, 0x00000010, 0x00000000, 0x20000010, 0xa0000000, 0x00000000,
|
||||
0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000001, 0x00000020, 0x00000001, 0x40000002,
|
||||
0x40000041, 0x40000022, 0x80000005, 0xc0000082, 0xc0000046, 0x4000004b,
|
||||
0x80000107, 0x00000089},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 54, DvB: 0, TestT: 65, MaskI: 0, MaskB: 29,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x0400001c, 0xcc000014, 0x0c000002, 0xc0000010, 0xb400001c, 0x3c000004,
|
||||
0xbc00001a, 0x20000010, 0x2400001c, 0xec000014, 0x0c000002, 0xc0000010,
|
||||
0xb400001c, 0x2c000004, 0xbc000018, 0xb0000010, 0x0000000c, 0xb8000010,
|
||||
0x08000018, 0x78000010, 0x08000014, 0x70000010, 0xb800001c, 0xe8000000,
|
||||
0xb0000004, 0x58000010, 0xb000000c, 0x48000000, 0xb0000000, 0xb8000010,
|
||||
0x98000010, 0xa0000000, 0x00000000, 0x00000000, 0x20000000, 0x80000000,
|
||||
0x00000010, 0x00000000, 0x20000010, 0x20000000, 0x00000010, 0x60000000,
|
||||
0x00000018, 0xe0000000, 0x90000000, 0x30000010, 0xb0000000, 0x20000000,
|
||||
0x20000000, 0xa0000000, 0x00000010, 0x80000000, 0x20000000, 0x20000000,
|
||||
0x20000000, 0x80000000, 0x00000010, 0x00000000, 0x20000010, 0xa0000000,
|
||||
0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000020, 0x00000001,
|
||||
0x40000002, 0x40000041, 0x40000022, 0x80000005, 0xc0000082, 0xc0000046,
|
||||
0x4000004b, 0x80000107},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 55, DvB: 0, TestT: 65, MaskI: 0, MaskB: 30,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x00000010, 0x0400001c, 0xcc000014, 0x0c000002, 0xc0000010, 0xb400001c,
|
||||
0x3c000004, 0xbc00001a, 0x20000010, 0x2400001c, 0xec000014, 0x0c000002,
|
||||
0xc0000010, 0xb400001c, 0x2c000004, 0xbc000018, 0xb0000010, 0x0000000c,
|
||||
0xb8000010, 0x08000018, 0x78000010, 0x08000014, 0x70000010, 0xb800001c,
|
||||
0xe8000000, 0xb0000004, 0x58000010, 0xb000000c, 0x48000000, 0xb0000000,
|
||||
0xb8000010, 0x98000010, 0xa0000000, 0x00000000, 0x00000000, 0x20000000,
|
||||
0x80000000, 0x00000010, 0x00000000, 0x20000010, 0x20000000, 0x00000010,
|
||||
0x60000000, 0x00000018, 0xe0000000, 0x90000000, 0x30000010, 0xb0000000,
|
||||
0x20000000, 0x20000000, 0xa0000000, 0x00000010, 0x80000000, 0x20000000,
|
||||
0x20000000, 0x20000000, 0x80000000, 0x00000010, 0x00000000, 0x20000010,
|
||||
0xa0000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000020,
|
||||
0x00000001, 0x40000002, 0x40000041, 0x40000022, 0x80000005, 0xc0000082,
|
||||
0xc0000046, 0x4000004b},
|
||||
},
|
||||
{
|
||||
DvType: 2, DvK: 56, DvB: 0, TestT: 65, MaskI: 0, MaskB: 31,
|
||||
Dm: [CheckSize]uint32{
|
||||
0x2600001a, 0x00000010, 0x0400001c, 0xcc000014, 0x0c000002, 0xc0000010,
|
||||
0xb400001c, 0x3c000004, 0xbc00001a, 0x20000010, 0x2400001c, 0xec000014,
|
||||
0x0c000002, 0xc0000010, 0xb400001c, 0x2c000004, 0xbc000018, 0xb0000010,
|
||||
0x0000000c, 0xb8000010, 0x08000018, 0x78000010, 0x08000014, 0x70000010,
|
||||
0xb800001c, 0xe8000000, 0xb0000004, 0x58000010, 0xb000000c, 0x48000000,
|
||||
0xb0000000, 0xb8000010, 0x98000010, 0xa0000000, 0x00000000, 0x00000000,
|
||||
0x20000000, 0x80000000, 0x00000010, 0x00000000, 0x20000010, 0x20000000,
|
||||
0x00000010, 0x60000000, 0x00000018, 0xe0000000, 0x90000000, 0x30000010,
|
||||
0xb0000000, 0x20000000, 0x20000000, 0xa0000000, 0x00000010, 0x80000000,
|
||||
0x20000000, 0x20000000, 0x20000000, 0x80000000, 0x00000010, 0x00000000,
|
||||
0x20000010, 0xa0000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
|
||||
0x00000020, 0x00000001, 0x40000002, 0x40000041, 0x40000022, 0x80000005,
|
||||
0xc0000082, 0xc0000046},
|
||||
},
|
||||
{
|
||||
DvType: 0, DvK: 0, DvB: 0, TestT: 0, MaskI: 0, MaskB: 0,
|
||||
Dm: [CheckSize]uint32{
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0},
|
||||
},
|
||||
}
|
||||
+376
@@ -0,0 +1,376 @@
|
||||
// ubc package provides ways for SHA1 blocks to be checked for
|
||||
// Unavoidable Bit Conditions that arise from crypto analysis attacks.
|
||||
package ubc
|
||||
|
||||
// Based on the C implementation from Marc Stevens and Dan Shumow.
|
||||
// https://github.com/cr-marcstevens/sha1collisiondetection
|
||||
|
||||
type DvInfo struct {
|
||||
// DvType, DvK and DvB define the DV: I(K,B) or II(K,B) (see the paper).
|
||||
// https://marc-stevens.nl/research/papers/C13-S.pdf
|
||||
DvType uint32
|
||||
DvK uint32
|
||||
DvB uint32
|
||||
|
||||
// TestT is the step to do the recompression from for collision detection.
|
||||
TestT uint32
|
||||
|
||||
// MaskI and MaskB define the bit to check for each DV in the dvmask returned by ubc_check.
|
||||
MaskI uint32
|
||||
MaskB uint32
|
||||
|
||||
// Dm is the expanded message block XOR-difference defined by the DV.
|
||||
Dm [80]uint32
|
||||
}
|
||||
|
||||
// CalculateDvMask takes as input an expanded message block and
|
||||
// verifies the unavoidable bitconditions for all listed DVs. It returns
|
||||
// a dvmask where each bit belonging to a DV is set if all unavoidable
|
||||
// bitconditions for that DV have been met.
|
||||
//
|
||||
//go:nosplit
|
||||
func CalculateDvMask(W *[80]uint32) uint32 {
|
||||
if W == nil {
|
||||
return 0
|
||||
}
|
||||
mask := uint32(0xFFFFFFFF)
|
||||
mask &= (((((W[44] ^ W[45]) >> 29) & 1) - 1) | ^(DV_I_48_0_bit | DV_I_51_0_bit | DV_I_52_0_bit | DV_II_45_0_bit | DV_II_46_0_bit | DV_II_50_0_bit | DV_II_51_0_bit))
|
||||
mask &= (((((W[49] ^ W[50]) >> 29) & 1) - 1) | ^(DV_I_46_0_bit | DV_II_45_0_bit | DV_II_50_0_bit | DV_II_51_0_bit | DV_II_55_0_bit | DV_II_56_0_bit))
|
||||
mask &= (((((W[48] ^ W[49]) >> 29) & 1) - 1) | ^(DV_I_45_0_bit | DV_I_52_0_bit | DV_II_49_0_bit | DV_II_50_0_bit | DV_II_54_0_bit | DV_II_55_0_bit))
|
||||
mask &= ((((W[47] ^ (W[50] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_I_47_0_bit | DV_I_49_0_bit | DV_I_51_0_bit | DV_II_45_0_bit | DV_II_51_0_bit | DV_II_56_0_bit))
|
||||
mask &= (((((W[47] ^ W[48]) >> 29) & 1) - 1) | ^(DV_I_44_0_bit | DV_I_51_0_bit | DV_II_48_0_bit | DV_II_49_0_bit | DV_II_53_0_bit | DV_II_54_0_bit))
|
||||
mask &= (((((W[46] >> 4) ^ (W[49] >> 29)) & 1) - 1) | ^(DV_I_46_0_bit | DV_I_48_0_bit | DV_I_50_0_bit | DV_I_52_0_bit | DV_II_50_0_bit | DV_II_55_0_bit))
|
||||
mask &= (((((W[46] ^ W[47]) >> 29) & 1) - 1) | ^(DV_I_43_0_bit | DV_I_50_0_bit | DV_II_47_0_bit | DV_II_48_0_bit | DV_II_52_0_bit | DV_II_53_0_bit))
|
||||
mask &= (((((W[45] >> 4) ^ (W[48] >> 29)) & 1) - 1) | ^(DV_I_45_0_bit | DV_I_47_0_bit | DV_I_49_0_bit | DV_I_51_0_bit | DV_II_49_0_bit | DV_II_54_0_bit))
|
||||
mask &= (((((W[45] ^ W[46]) >> 29) & 1) - 1) | ^(DV_I_49_0_bit | DV_I_52_0_bit | DV_II_46_0_bit | DV_II_47_0_bit | DV_II_51_0_bit | DV_II_52_0_bit))
|
||||
mask &= (((((W[44] >> 4) ^ (W[47] >> 29)) & 1) - 1) | ^(DV_I_44_0_bit | DV_I_46_0_bit | DV_I_48_0_bit | DV_I_50_0_bit | DV_II_48_0_bit | DV_II_53_0_bit))
|
||||
mask &= (((((W[43] >> 4) ^ (W[46] >> 29)) & 1) - 1) | ^(DV_I_43_0_bit | DV_I_45_0_bit | DV_I_47_0_bit | DV_I_49_0_bit | DV_II_47_0_bit | DV_II_52_0_bit))
|
||||
mask &= (((((W[43] ^ W[44]) >> 29) & 1) - 1) | ^(DV_I_47_0_bit | DV_I_50_0_bit | DV_I_51_0_bit | DV_II_45_0_bit | DV_II_49_0_bit | DV_II_50_0_bit))
|
||||
mask &= (((((W[42] >> 4) ^ (W[45] >> 29)) & 1) - 1) | ^(DV_I_44_0_bit | DV_I_46_0_bit | DV_I_48_0_bit | DV_I_52_0_bit | DV_II_46_0_bit | DV_II_51_0_bit))
|
||||
mask &= (((((W[41] >> 4) ^ (W[44] >> 29)) & 1) - 1) | ^(DV_I_43_0_bit | DV_I_45_0_bit | DV_I_47_0_bit | DV_I_51_0_bit | DV_II_45_0_bit | DV_II_50_0_bit))
|
||||
mask &= (((((W[40] ^ W[41]) >> 29) & 1) - 1) | ^(DV_I_44_0_bit | DV_I_47_0_bit | DV_I_48_0_bit | DV_II_46_0_bit | DV_II_47_0_bit | DV_II_56_0_bit))
|
||||
mask &= (((((W[54] ^ W[55]) >> 29) & 1) - 1) | ^(DV_I_51_0_bit | DV_II_47_0_bit | DV_II_50_0_bit | DV_II_55_0_bit | DV_II_56_0_bit))
|
||||
mask &= (((((W[53] ^ W[54]) >> 29) & 1) - 1) | ^(DV_I_50_0_bit | DV_II_46_0_bit | DV_II_49_0_bit | DV_II_54_0_bit | DV_II_55_0_bit))
|
||||
mask &= (((((W[52] ^ W[53]) >> 29) & 1) - 1) | ^(DV_I_49_0_bit | DV_II_45_0_bit | DV_II_48_0_bit | DV_II_53_0_bit | DV_II_54_0_bit))
|
||||
mask &= ((((W[50] ^ (W[53] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_I_50_0_bit | DV_I_52_0_bit | DV_II_46_0_bit | DV_II_48_0_bit | DV_II_54_0_bit))
|
||||
mask &= (((((W[50] ^ W[51]) >> 29) & 1) - 1) | ^(DV_I_47_0_bit | DV_II_46_0_bit | DV_II_51_0_bit | DV_II_52_0_bit | DV_II_56_0_bit))
|
||||
mask &= ((((W[49] ^ (W[52] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_I_49_0_bit | DV_I_51_0_bit | DV_II_45_0_bit | DV_II_47_0_bit | DV_II_53_0_bit))
|
||||
mask &= ((((W[48] ^ (W[51] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_I_48_0_bit | DV_I_50_0_bit | DV_I_52_0_bit | DV_II_46_0_bit | DV_II_52_0_bit))
|
||||
mask &= (((((W[42] ^ W[43]) >> 29) & 1) - 1) | ^(DV_I_46_0_bit | DV_I_49_0_bit | DV_I_50_0_bit | DV_II_48_0_bit | DV_II_49_0_bit))
|
||||
mask &= (((((W[41] ^ W[42]) >> 29) & 1) - 1) | ^(DV_I_45_0_bit | DV_I_48_0_bit | DV_I_49_0_bit | DV_II_47_0_bit | DV_II_48_0_bit))
|
||||
mask &= (((((W[40] >> 4) ^ (W[43] >> 29)) & 1) - 1) | ^(DV_I_44_0_bit | DV_I_46_0_bit | DV_I_50_0_bit | DV_II_49_0_bit | DV_II_56_0_bit))
|
||||
mask &= (((((W[39] >> 4) ^ (W[42] >> 29)) & 1) - 1) | ^(DV_I_43_0_bit | DV_I_45_0_bit | DV_I_49_0_bit | DV_II_48_0_bit | DV_II_55_0_bit))
|
||||
|
||||
if (mask & (DV_I_44_0_bit | DV_I_48_0_bit | DV_II_47_0_bit | DV_II_54_0_bit | DV_II_56_0_bit)) != 0 {
|
||||
mask &= (((((W[38] >> 4) ^ (W[41] >> 29)) & 1) - 1) | ^(DV_I_44_0_bit | DV_I_48_0_bit | DV_II_47_0_bit | DV_II_54_0_bit | DV_II_56_0_bit))
|
||||
}
|
||||
mask &= (((((W[37] >> 4) ^ (W[40] >> 29)) & 1) - 1) | ^(DV_I_43_0_bit | DV_I_47_0_bit | DV_II_46_0_bit | DV_II_53_0_bit | DV_II_55_0_bit))
|
||||
if (mask & (DV_I_52_0_bit | DV_II_48_0_bit | DV_II_51_0_bit | DV_II_56_0_bit)) != 0 {
|
||||
mask &= (((((W[55] ^ W[56]) >> 29) & 1) - 1) | ^(DV_I_52_0_bit | DV_II_48_0_bit | DV_II_51_0_bit | DV_II_56_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_52_0_bit | DV_II_48_0_bit | DV_II_50_0_bit | DV_II_56_0_bit)) != 0 {
|
||||
mask &= ((((W[52] ^ (W[55] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_I_52_0_bit | DV_II_48_0_bit | DV_II_50_0_bit | DV_II_56_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_51_0_bit | DV_II_47_0_bit | DV_II_49_0_bit | DV_II_55_0_bit)) != 0 {
|
||||
mask &= ((((W[51] ^ (W[54] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_I_51_0_bit | DV_II_47_0_bit | DV_II_49_0_bit | DV_II_55_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_48_0_bit | DV_II_47_0_bit | DV_II_52_0_bit | DV_II_53_0_bit)) != 0 {
|
||||
mask &= (((((W[51] ^ W[52]) >> 29) & 1) - 1) | ^(DV_I_48_0_bit | DV_II_47_0_bit | DV_II_52_0_bit | DV_II_53_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_46_0_bit | DV_I_49_0_bit | DV_II_45_0_bit | DV_II_48_0_bit)) != 0 {
|
||||
mask &= (((((W[36] >> 4) ^ (W[40] >> 29)) & 1) - 1) | ^(DV_I_46_0_bit | DV_I_49_0_bit | DV_II_45_0_bit | DV_II_48_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_52_0_bit | DV_II_48_0_bit | DV_II_49_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[53] ^ W[56]) >> 29) & 1)) | ^(DV_I_52_0_bit | DV_II_48_0_bit | DV_II_49_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_50_0_bit | DV_II_46_0_bit | DV_II_47_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[51] ^ W[54]) >> 29) & 1)) | ^(DV_I_50_0_bit | DV_II_46_0_bit | DV_II_47_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_49_0_bit | DV_I_51_0_bit | DV_II_45_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[50] ^ W[52]) >> 29) & 1)) | ^(DV_I_49_0_bit | DV_I_51_0_bit | DV_II_45_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_48_0_bit | DV_I_50_0_bit | DV_I_52_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[49] ^ W[51]) >> 29) & 1)) | ^(DV_I_48_0_bit | DV_I_50_0_bit | DV_I_52_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_47_0_bit | DV_I_49_0_bit | DV_I_51_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[48] ^ W[50]) >> 29) & 1)) | ^(DV_I_47_0_bit | DV_I_49_0_bit | DV_I_51_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_46_0_bit | DV_I_48_0_bit | DV_I_50_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[47] ^ W[49]) >> 29) & 1)) | ^(DV_I_46_0_bit | DV_I_48_0_bit | DV_I_50_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_45_0_bit | DV_I_47_0_bit | DV_I_49_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[46] ^ W[48]) >> 29) & 1)) | ^(DV_I_45_0_bit | DV_I_47_0_bit | DV_I_49_0_bit))
|
||||
}
|
||||
mask &= ((((W[45] ^ W[47]) & (1 << 6)) - (1 << 6)) | ^(DV_I_47_2_bit | DV_I_49_2_bit | DV_I_51_2_bit))
|
||||
if (mask & (DV_I_44_0_bit | DV_I_46_0_bit | DV_I_48_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[45] ^ W[47]) >> 29) & 1)) | ^(DV_I_44_0_bit | DV_I_46_0_bit | DV_I_48_0_bit))
|
||||
}
|
||||
mask &= (((((W[44] ^ W[46]) >> 6) & 1) - 1) | ^(DV_I_46_2_bit | DV_I_48_2_bit | DV_I_50_2_bit))
|
||||
if (mask & (DV_I_43_0_bit | DV_I_45_0_bit | DV_I_47_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[44] ^ W[46]) >> 29) & 1)) | ^(DV_I_43_0_bit | DV_I_45_0_bit | DV_I_47_0_bit))
|
||||
}
|
||||
mask &= ((0 - ((W[41] ^ (W[42] >> 5)) & (1 << 1))) | ^(DV_I_48_2_bit | DV_II_46_2_bit | DV_II_51_2_bit))
|
||||
mask &= ((0 - ((W[40] ^ (W[41] >> 5)) & (1 << 1))) | ^(DV_I_47_2_bit | DV_I_51_2_bit | DV_II_50_2_bit))
|
||||
if (mask & (DV_I_44_0_bit | DV_I_46_0_bit | DV_II_56_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[40] ^ W[42]) >> 4) & 1)) | ^(DV_I_44_0_bit | DV_I_46_0_bit | DV_II_56_0_bit))
|
||||
}
|
||||
mask &= ((0 - ((W[39] ^ (W[40] >> 5)) & (1 << 1))) | ^(DV_I_46_2_bit | DV_I_50_2_bit | DV_II_49_2_bit))
|
||||
if (mask & (DV_I_43_0_bit | DV_I_45_0_bit | DV_II_55_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[39] ^ W[41]) >> 4) & 1)) | ^(DV_I_43_0_bit | DV_I_45_0_bit | DV_II_55_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_44_0_bit | DV_II_54_0_bit | DV_II_56_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[38] ^ W[40]) >> 4) & 1)) | ^(DV_I_44_0_bit | DV_II_54_0_bit | DV_II_56_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_43_0_bit | DV_II_53_0_bit | DV_II_55_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[37] ^ W[39]) >> 4) & 1)) | ^(DV_I_43_0_bit | DV_II_53_0_bit | DV_II_55_0_bit))
|
||||
}
|
||||
mask &= ((0 - ((W[36] ^ (W[37] >> 5)) & (1 << 1))) | ^(DV_I_47_2_bit | DV_I_50_2_bit | DV_II_46_2_bit))
|
||||
if (mask & (DV_I_45_0_bit | DV_I_48_0_bit | DV_II_47_0_bit)) != 0 {
|
||||
mask &= (((((W[35] >> 4) ^ (W[39] >> 29)) & 1) - 1) | ^(DV_I_45_0_bit | DV_I_48_0_bit | DV_II_47_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_48_0_bit | DV_II_48_0_bit)) != 0 {
|
||||
mask &= ((0 - ((W[63] ^ (W[64] >> 5)) & (1 << 0))) | ^(DV_I_48_0_bit | DV_II_48_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_45_0_bit | DV_II_45_0_bit)) != 0 {
|
||||
mask &= ((0 - ((W[63] ^ (W[64] >> 5)) & (1 << 1))) | ^(DV_I_45_0_bit | DV_II_45_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_47_0_bit | DV_II_47_0_bit)) != 0 {
|
||||
mask &= ((0 - ((W[62] ^ (W[63] >> 5)) & (1 << 0))) | ^(DV_I_47_0_bit | DV_II_47_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_46_0_bit | DV_II_46_0_bit)) != 0 {
|
||||
mask &= ((0 - ((W[61] ^ (W[62] >> 5)) & (1 << 0))) | ^(DV_I_46_0_bit | DV_II_46_0_bit))
|
||||
}
|
||||
mask &= ((0 - ((W[61] ^ (W[62] >> 5)) & (1 << 2))) | ^(DV_I_46_2_bit | DV_II_46_2_bit))
|
||||
if (mask & (DV_I_45_0_bit | DV_II_45_0_bit)) != 0 {
|
||||
mask &= ((0 - ((W[60] ^ (W[61] >> 5)) & (1 << 0))) | ^(DV_I_45_0_bit | DV_II_45_0_bit))
|
||||
}
|
||||
if (mask & (DV_II_51_0_bit | DV_II_54_0_bit)) != 0 {
|
||||
mask &= (((((W[58] ^ W[59]) >> 29) & 1) - 1) | ^(DV_II_51_0_bit | DV_II_54_0_bit))
|
||||
}
|
||||
if (mask & (DV_II_50_0_bit | DV_II_53_0_bit)) != 0 {
|
||||
mask &= (((((W[57] ^ W[58]) >> 29) & 1) - 1) | ^(DV_II_50_0_bit | DV_II_53_0_bit))
|
||||
}
|
||||
if (mask & (DV_II_52_0_bit | DV_II_54_0_bit)) != 0 {
|
||||
mask &= ((((W[56] ^ (W[59] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_II_52_0_bit | DV_II_54_0_bit))
|
||||
}
|
||||
if (mask & (DV_II_51_0_bit | DV_II_52_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[56] ^ W[59]) >> 29) & 1)) | ^(DV_II_51_0_bit | DV_II_52_0_bit))
|
||||
}
|
||||
if (mask & (DV_II_49_0_bit | DV_II_52_0_bit)) != 0 {
|
||||
mask &= (((((W[56] ^ W[57]) >> 29) & 1) - 1) | ^(DV_II_49_0_bit | DV_II_52_0_bit))
|
||||
}
|
||||
if (mask & (DV_II_51_0_bit | DV_II_53_0_bit)) != 0 {
|
||||
mask &= ((((W[55] ^ (W[58] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_II_51_0_bit | DV_II_53_0_bit))
|
||||
}
|
||||
if (mask & (DV_II_50_0_bit | DV_II_52_0_bit)) != 0 {
|
||||
mask &= ((((W[54] ^ (W[57] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_II_50_0_bit | DV_II_52_0_bit))
|
||||
}
|
||||
if (mask & (DV_II_49_0_bit | DV_II_51_0_bit)) != 0 {
|
||||
mask &= ((((W[53] ^ (W[56] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_II_49_0_bit | DV_II_51_0_bit))
|
||||
}
|
||||
mask &= ((((W[51] ^ (W[50] >> 5)) & (1 << 1)) - (1 << 1)) | ^(DV_I_50_2_bit | DV_II_46_2_bit))
|
||||
mask &= ((((W[48] ^ W[50]) & (1 << 6)) - (1 << 6)) | ^(DV_I_50_2_bit | DV_II_46_2_bit))
|
||||
if (mask & (DV_I_51_0_bit | DV_I_52_0_bit)) != 0 {
|
||||
mask &= ((0 - (((W[48] ^ W[55]) >> 29) & 1)) | ^(DV_I_51_0_bit | DV_I_52_0_bit))
|
||||
}
|
||||
mask &= ((((W[47] ^ W[49]) & (1 << 6)) - (1 << 6)) | ^(DV_I_49_2_bit | DV_I_51_2_bit))
|
||||
mask &= ((((W[48] ^ (W[47] >> 5)) & (1 << 1)) - (1 << 1)) | ^(DV_I_47_2_bit | DV_II_51_2_bit))
|
||||
mask &= ((((W[46] ^ W[48]) & (1 << 6)) - (1 << 6)) | ^(DV_I_48_2_bit | DV_I_50_2_bit))
|
||||
mask &= ((((W[47] ^ (W[46] >> 5)) & (1 << 1)) - (1 << 1)) | ^(DV_I_46_2_bit | DV_II_50_2_bit))
|
||||
mask &= ((0 - ((W[44] ^ (W[45] >> 5)) & (1 << 1))) | ^(DV_I_51_2_bit | DV_II_49_2_bit))
|
||||
mask &= ((((W[43] ^ W[45]) & (1 << 6)) - (1 << 6)) | ^(DV_I_47_2_bit | DV_I_49_2_bit))
|
||||
mask &= (((((W[42] ^ W[44]) >> 6) & 1) - 1) | ^(DV_I_46_2_bit | DV_I_48_2_bit))
|
||||
mask &= ((((W[43] ^ (W[42] >> 5)) & (1 << 1)) - (1 << 1)) | ^(DV_II_46_2_bit | DV_II_51_2_bit))
|
||||
mask &= ((((W[42] ^ (W[41] >> 5)) & (1 << 1)) - (1 << 1)) | ^(DV_I_51_2_bit | DV_II_50_2_bit))
|
||||
mask &= ((((W[41] ^ (W[40] >> 5)) & (1 << 1)) - (1 << 1)) | ^(DV_I_50_2_bit | DV_II_49_2_bit))
|
||||
if (mask & (DV_I_52_0_bit | DV_II_51_0_bit)) != 0 {
|
||||
mask &= ((((W[39] ^ (W[43] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_I_52_0_bit | DV_II_51_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_51_0_bit | DV_II_50_0_bit)) != 0 {
|
||||
mask &= ((((W[38] ^ (W[42] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_I_51_0_bit | DV_II_50_0_bit))
|
||||
}
|
||||
if (mask & (DV_I_48_2_bit | DV_I_51_2_bit)) != 0 {
|
||||
mask &= ((0 - ((W[37] ^ (W[38] >> 5)) & (1 << 1))) | ^(DV_I_48_2_bit | DV_I_51_2_bit))
|
||||
}
|
||||
if (mask & (DV_I_50_0_bit | DV_II_49_0_bit)) != 0 {
|
||||
mask &= ((((W[37] ^ (W[41] >> 25)) & (1 << 4)) - (1 << 4)) | ^(DV_I_50_0_bit | DV_II_49_0_bit))
|
||||
}
|
||||
if (mask & (DV_II_52_0_bit | DV_II_54_0_bit)) != 0 {
|
||||
mask &= ((0 - ((W[36] ^ W[38]) & (1 << 4))) | ^(DV_II_52_0_bit | DV_II_54_0_bit))
|
||||
}
|
||||
mask &= ((0 - ((W[35] ^ (W[36] >> 5)) & (1 << 1))) | ^(DV_I_46_2_bit | DV_I_49_2_bit))
|
||||
if (mask & (DV_I_51_0_bit | DV_II_47_0_bit)) != 0 {
|
||||
mask &= ((((W[35] ^ (W[39] >> 25)) & (1 << 3)) - (1 << 3)) | ^(DV_I_51_0_bit | DV_II_47_0_bit))
|
||||
}
|
||||
|
||||
if mask != 0 {
|
||||
if (mask & DV_I_43_0_bit) != 0 {
|
||||
if not((W[61]^(W[62]>>5))&(1<<1)) != 0 ||
|
||||
not(not((W[59]^(W[63]>>25))&(1<<5))) != 0 ||
|
||||
not((W[58]^(W[63]>>30))&(1<<0)) != 0 {
|
||||
mask &= ^DV_I_43_0_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_I_44_0_bit) != 0 {
|
||||
if not((W[62]^(W[63]>>5))&(1<<1)) != 0 ||
|
||||
not(not((W[60]^(W[64]>>25))&(1<<5))) != 0 ||
|
||||
not((W[59]^(W[64]>>30))&(1<<0)) != 0 {
|
||||
mask &= ^DV_I_44_0_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_I_46_2_bit) != 0 {
|
||||
mask &= ((^((W[40] ^ W[42]) >> 2)) | ^DV_I_46_2_bit)
|
||||
}
|
||||
if (mask & DV_I_47_2_bit) != 0 {
|
||||
if not((W[62]^(W[63]>>5))&(1<<2)) != 0 ||
|
||||
not(not((W[41]^W[43])&(1<<6))) != 0 {
|
||||
mask &= ^DV_I_47_2_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_I_48_2_bit) != 0 {
|
||||
if not((W[63]^(W[64]>>5))&(1<<2)) != 0 ||
|
||||
not(not((W[48]^(W[49]<<5))&(1<<6))) != 0 {
|
||||
mask &= ^DV_I_48_2_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_I_49_2_bit) != 0 {
|
||||
if not(not((W[49]^(W[50]<<5))&(1<<6))) != 0 ||
|
||||
not((W[42]^W[50])&(1<<1)) != 0 ||
|
||||
not(not((W[39]^(W[40]<<5))&(1<<6))) != 0 ||
|
||||
not((W[38]^W[40])&(1<<1)) != 0 {
|
||||
mask &= ^DV_I_49_2_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_I_50_0_bit) != 0 {
|
||||
mask &= (((W[36] ^ W[37]) << 7) | ^DV_I_50_0_bit)
|
||||
}
|
||||
if (mask & DV_I_50_2_bit) != 0 {
|
||||
mask &= (((W[43] ^ W[51]) << 11) | ^DV_I_50_2_bit)
|
||||
}
|
||||
if (mask & DV_I_51_0_bit) != 0 {
|
||||
mask &= (((W[37] ^ W[38]) << 9) | ^DV_I_51_0_bit)
|
||||
}
|
||||
if (mask & DV_I_51_2_bit) != 0 {
|
||||
if not(not((W[51]^(W[52]<<5))&(1<<6))) != 0 ||
|
||||
not(not((W[49]^W[51])&(1<<6))) != 0 ||
|
||||
not(not((W[37]^(W[37]>>5))&(1<<1))) != 0 ||
|
||||
not(not((W[35]^(W[39]>>25))&(1<<5))) != 0 {
|
||||
mask &= ^DV_I_51_2_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_I_52_0_bit) != 0 {
|
||||
mask &= (((W[38] ^ W[39]) << 11) | ^DV_I_52_0_bit)
|
||||
}
|
||||
if (mask & DV_II_46_2_bit) != 0 {
|
||||
mask &= (((W[47] ^ W[51]) << 17) | ^DV_II_46_2_bit)
|
||||
}
|
||||
if (mask & DV_II_48_0_bit) != 0 {
|
||||
if not(not((W[36]^(W[40]>>25))&(1<<3))) != 0 ||
|
||||
not((W[35]^(W[40]<<2))&(1<<30)) != 0 {
|
||||
mask &= ^DV_II_48_0_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_49_0_bit) != 0 {
|
||||
if not(not((W[37]^(W[41]>>25))&(1<<3))) != 0 ||
|
||||
not((W[36]^(W[41]<<2))&(1<<30)) != 0 {
|
||||
mask &= ^DV_II_49_0_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_49_2_bit) != 0 {
|
||||
if not(not((W[53]^(W[54]<<5))&(1<<6))) != 0 ||
|
||||
not(not((W[51]^W[53])&(1<<6))) != 0 ||
|
||||
not((W[50]^W[54])&(1<<1)) != 0 ||
|
||||
not(not((W[45]^(W[46]<<5))&(1<<6))) != 0 ||
|
||||
not(not((W[37]^(W[41]>>25))&(1<<5))) != 0 ||
|
||||
not((W[36]^(W[41]>>30))&(1<<0)) != 0 {
|
||||
mask &= ^DV_II_49_2_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_50_0_bit) != 0 {
|
||||
if not((W[55]^W[58])&(1<<29)) != 0 ||
|
||||
not(not((W[38]^(W[42]>>25))&(1<<3))) != 0 ||
|
||||
not((W[37]^(W[42]<<2))&(1<<30)) != 0 {
|
||||
mask &= ^DV_II_50_0_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_50_2_bit) != 0 {
|
||||
if not(not((W[54]^(W[55]<<5))&(1<<6))) != 0 ||
|
||||
not(not((W[52]^W[54])&(1<<6))) != 0 ||
|
||||
not((W[51]^W[55])&(1<<1)) != 0 ||
|
||||
not((W[45]^W[47])&(1<<1)) != 0 ||
|
||||
not(not((W[38]^(W[42]>>25))&(1<<5))) != 0 ||
|
||||
not((W[37]^(W[42]>>30))&(1<<0)) != 0 {
|
||||
mask &= ^DV_II_50_2_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_51_0_bit) != 0 {
|
||||
if not(not((W[39]^(W[43]>>25))&(1<<3))) != 0 ||
|
||||
not((W[38]^(W[43]<<2))&(1<<30)) != 0 {
|
||||
mask &= ^DV_II_51_0_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_51_2_bit) != 0 {
|
||||
if not(not((W[55]^(W[56]<<5))&(1<<6))) != 0 ||
|
||||
not(not((W[53]^W[55])&(1<<6))) != 0 ||
|
||||
not((W[52]^W[56])&(1<<1)) != 0 ||
|
||||
not((W[46]^W[48])&(1<<1)) != 0 ||
|
||||
not(not((W[39]^(W[43]>>25))&(1<<5))) != 0 ||
|
||||
not((W[38]^(W[43]>>30))&(1<<0)) != 0 {
|
||||
mask &= ^DV_II_51_2_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_52_0_bit) != 0 {
|
||||
if not(not((W[59]^W[60])&(1<<29))) != 0 ||
|
||||
not(not((W[40]^(W[44]>>25))&(1<<3))) != 0 ||
|
||||
not(not((W[40]^(W[44]>>25))&(1<<4))) != 0 ||
|
||||
not((W[39]^(W[44]<<2))&(1<<30)) != 0 {
|
||||
mask &= ^DV_II_52_0_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_53_0_bit) != 0 {
|
||||
if not((W[58]^W[61])&(1<<29)) != 0 ||
|
||||
not(not((W[57]^(W[61]>>25))&(1<<4))) != 0 ||
|
||||
not(not((W[41]^(W[45]>>25))&(1<<3))) != 0 ||
|
||||
not(not((W[41]^(W[45]>>25))&(1<<4))) != 0 {
|
||||
mask &= ^DV_II_53_0_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_54_0_bit) != 0 {
|
||||
if not(not((W[58]^(W[62]>>25))&(1<<4))) != 0 ||
|
||||
not(not((W[42]^(W[46]>>25))&(1<<3))) != 0 ||
|
||||
not(not((W[42]^(W[46]>>25))&(1<<4))) != 0 {
|
||||
mask &= ^DV_II_54_0_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_55_0_bit) != 0 {
|
||||
if not(not((W[59]^(W[63]>>25))&(1<<4))) != 0 ||
|
||||
not(not((W[57]^(W[59]>>25))&(1<<4))) != 0 ||
|
||||
not(not((W[43]^(W[47]>>25))&(1<<3))) != 0 ||
|
||||
not(not((W[43]^(W[47]>>25))&(1<<4))) != 0 {
|
||||
mask &= ^DV_II_55_0_bit
|
||||
}
|
||||
}
|
||||
if (mask & DV_II_56_0_bit) != 0 {
|
||||
if not(not((W[60]^(W[64]>>25))&(1<<4))) != 0 ||
|
||||
not(not((W[44]^(W[48]>>25))&(1<<3))) != 0 ||
|
||||
not(not((W[44]^(W[48]>>25))&(1<<4))) != 0 {
|
||||
mask &= ^DV_II_56_0_bit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mask
|
||||
}
|
||||
|
||||
func not(x uint32) uint32 {
|
||||
if x == 0 {
|
||||
return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func SHA1_dvs() []DvInfo {
|
||||
return sha1_dvs
|
||||
}
|
||||
Reference in New Issue
Block a user