Documentation ¶
Overview ¶
Package zuc handle shangmi zuc stream cipher, experimental/poc implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ZUC128Mac ¶
type ZUC128Mac struct {
// contains filtered or unexported fields
}
func NewEIAHash ¶
NewEIAHash create hash for zuc-128 eia, with arguments key, count, bearer and direction
func NewHash ¶
NewHash create hash for zuc-128 eia, with arguments key and iv. Both key/iv size are 16 in bytes.
func (*ZUC128Mac) Finish ¶
Finish this function hash nbits data in p and return mac value In general, we will use byte level function, this is just for test/verify.
func (*ZUC128Mac) XORKeyStream ¶
func (c *ZUC128Mac) XORKeyStream(dst, src []byte)
Per test, even we generate key stream first, and then XOR once, the performance improvement is NOT significant.
type ZUC256Mac ¶
type ZUC256Mac struct {
// contains filtered or unexported fields
}
func NewHash256 ¶
NewHash256 create hash for zuc-256 eia, with arguments key, iv and tagSize. Key size is 32 in bytes, iv size is 23 in bytes, tagSize supports 4/8/16 in bytes. The larger the tag size, the worse the performance.
func (*ZUC256Mac) Finish ¶
Finish this function hash nbits data in p and return mac value In general, we will use byte level function, this is just for test/verify.
func (*ZUC256Mac) XORKeyStream ¶
func (c *ZUC256Mac) XORKeyStream(dst, src []byte)
Per test, even we generate key stream first, and then XOR once, the performance improvement is NOT significant.