vendor: update klauspost/reedsomon package with upstream changes. (#1912)

This commit is contained in:
Harshavardhana
2016-06-17 15:16:26 +05:30
committed by GitHub
parent 466a2e01f1
commit 7f38f46e20
3 changed files with 30 additions and 6 deletions

View File

@@ -85,10 +85,14 @@ type reedSolomon struct {
}
// ErrInvShardNum will be returned by New, if you attempt to create
// an Encoder where either data or parity shards is zero or less,
// or the number of data shards is higher than 256.
// an Encoder where either data or parity shards is zero or less.
var ErrInvShardNum = errors.New("cannot create Encoder with zero or less data/parity shards")
// ErrMaxShardNum will be returned by New, if you attempt to create
// an Encoder where data and parity shards cannot be bigger than
// Galois field GF(2^8) - 1.
var ErrMaxShardNum = errors.New("cannot create Encoder with 255 or more data+parity shards")
// New creates a new encoder and initializes it to
// the number of data shards and parity shards that
// you want to use. You can reuse this encoder.
@@ -104,8 +108,8 @@ func New(dataShards, parityShards int) (Encoder, error) {
return nil, ErrInvShardNum
}
if dataShards > 256 {
return nil, ErrInvShardNum
if dataShards+parityShards > 255 {
return nil, ErrMaxShardNum
}
// Start with a Vandermonde matrix. This matrix would work,