mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-14 04:56:21 +08:00
internal/zuc: supplement comments
This commit is contained in:
parent
d3eece5560
commit
0ef30b3ab5
@ -23,7 +23,7 @@ type eea struct {
|
|||||||
used uint64 // number of key bytes processed, current offset
|
used uint64 // number of key bytes processed, current offset
|
||||||
states []*zucState32 // internal states for seek
|
states []*zucState32 // internal states for seek
|
||||||
stateIndex int // current state index, for test usage
|
stateIndex int // current state index, for test usage
|
||||||
bucketSize int
|
bucketSize int // size of the state bucket, 0 means no bucket
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCipher creates a stream cipher based on key and iv aguments.
|
// NewCipher creates a stream cipher based on key and iv aguments.
|
||||||
@ -57,6 +57,7 @@ func NewCipherWithBucketSize(key, iv []byte, bucketSize int) (*eea, error) {
|
|||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reference GB/T 33133.2-2021 A.2
|
||||||
func construcIV4EEA(count, bearer, direction uint32) []byte {
|
func construcIV4EEA(count, bearer, direction uint32) []byte {
|
||||||
iv := make([]byte, 16)
|
iv := make([]byte, 16)
|
||||||
byteorder.BEPutUint32(iv, count)
|
byteorder.BEPutUint32(iv, count)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user