summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/rc4/rc4_ref.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/crypto/rc4/rc4_ref.go')
-rw-r--r--src/pkg/crypto/rc4/rc4_ref.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/pkg/crypto/rc4/rc4_ref.go b/src/pkg/crypto/rc4/rc4_ref.go
index 44d380436..1ecce1a7f 100644
--- a/src/pkg/crypto/rc4/rc4_ref.go
+++ b/src/pkg/crypto/rc4/rc4_ref.go
@@ -2,19 +2,12 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !amd64,!arm,!386
+// +build !amd64,!amd64p32,!arm,!386
package rc4
// XORKeyStream sets dst to the result of XORing src with the key stream.
// Dst and src may be the same slice but otherwise should not overlap.
func (c *Cipher) XORKeyStream(dst, src []byte) {
- i, j := c.i, c.j
- for k, v := range src {
- i += 1
- j += c.s[i]
- c.s[i], c.s[j] = c.s[j], c.s[i]
- dst[k] = v ^ c.s[c.s[i]+c.s[j]]
- }
- c.i, c.j = i, j
+ c.xorKeyStreamGeneric(dst, src)
}