2018-11-12 15:25:55 +03:00
|
|
|
//+build !amd64 noasm appengine gccgo
|
|
|
|
//+build !arm64 noasm appengine gccgo
|
2018-12-18 22:39:59 +03:00
|
|
|
//+build !ppc64le noasm appengine gccgo
|
2015-06-21 22:23:22 +03:00
|
|
|
|
|
|
|
// Copyright 2015, Klaus Post, see LICENSE for details.
|
|
|
|
|
|
|
|
package reedsolomon
|
|
|
|
|
2019-02-10 13:17:23 +03:00
|
|
|
func galMulSlice(c byte, in, out []byte, o *options) {
|
2019-03-08 12:49:27 +03:00
|
|
|
out = out[:len(in)]
|
2020-05-06 12:14:25 +03:00
|
|
|
if c == 1 {
|
|
|
|
copy(out, in)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
mt := mulTable[c][:256]
|
2015-06-21 22:23:22 +03:00
|
|
|
for n, input := range in {
|
|
|
|
out[n] = mt[input]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-10 13:17:23 +03:00
|
|
|
func galMulSliceXor(c byte, in, out []byte, o *options) {
|
2019-03-08 12:49:27 +03:00
|
|
|
out = out[:len(in)]
|
2020-05-06 12:14:25 +03:00
|
|
|
if c == 1 {
|
|
|
|
for n, input := range in {
|
|
|
|
out[n] ^= input
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
mt := mulTable[c][:256]
|
2015-06-21 22:23:22 +03:00
|
|
|
for n, input := range in {
|
|
|
|
out[n] ^= mt[input]
|
|
|
|
}
|
|
|
|
}
|
2017-08-20 12:42:39 +03:00
|
|
|
|
|
|
|
// slice galois add
|
2020-05-06 12:14:25 +03:00
|
|
|
func sliceXor(in, out []byte, o *options) {
|
2017-08-20 12:42:39 +03:00
|
|
|
for n, input := range in {
|
|
|
|
out[n] ^= input
|
|
|
|
}
|
|
|
|
}
|
2019-02-10 13:17:23 +03:00
|
|
|
|
2020-04-22 16:38:21 +03:00
|
|
|
func init() {
|
|
|
|
defaultOptions.useAVX512 = false
|
|
|
|
}
|