Fix: algorithm bugs in qmc

Optimize: algorithm in `kgm`
This commit is contained in:
Emmm Monster
2021-08-03 04:17:10 +08:00
parent 60c15894c0
commit 28d84e4dc2
3 changed files with 6 additions and 10 deletions

View File

@@ -39,7 +39,7 @@ func NewKey256FromMask44(mask44 []byte) (*Key256Mask, error) {
return q, nil
}
func (q *Key256Mask) getMatrix44() (mask44 []byte, err error) {
func (q *Key256Mask) GetMatrix44() ([]byte, error) {
if len(q.matrix) != 128 {
return nil, ErrMaskLength128
}
@@ -53,7 +53,7 @@ func (q *Key256Mask) getMatrix44() (mask44 []byte, err error) {
return nil, ErrMaskDecode
}
}
q.matrix[idx44] = q.matrix[it256[0]]
matrix44[idx44] = q.matrix[it256[0]]
idx44++
}
}