Revert "salsa20: add loong64 SIMD implementation"
This reverts CL 663375. Reason for revert: Does not build on 1.23 or 1.24 For golang/go#73354. Change-Id: I251d598423b83c01cc2e04ddf6f49ae14095fa7c Reviewed-on: https://go-review.googlesource.com/c/crypto/+/665535 Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: abner chenc <chenguoqi@loongson.cn> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
committed by
Gopher Robot
parent
7c358664da
commit
51f005cfd4
@@ -1,31 +0,0 @@
|
||||
// Copyright 2019 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.
|
||||
|
||||
//go:build (amd64 || loong64) && !purego && gc
|
||||
|
||||
package salsa
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCounterOverflow(t *testing.T) {
|
||||
in := make([]byte, 4096)
|
||||
key := &[32]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
|
||||
6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2}
|
||||
for n, counter := range []*[16]byte{
|
||||
&[16]byte{0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0}, // zero counter
|
||||
&[16]byte{0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff}, // counter about to overflow 32 bits
|
||||
&[16]byte{0, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 0xff, 0xff, 0xff, 0xff}, // counter above 32 bits
|
||||
} {
|
||||
out := make([]byte, 4096)
|
||||
XORKeyStream(out, in, counter, key)
|
||||
outGeneric := make([]byte, 4096)
|
||||
genericXORKeyStream(outGeneric, in, counter, key)
|
||||
if !bytes.Equal(out, outGeneric) {
|
||||
t.Errorf("%d: assembly and go implementations disagree", n)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user