github.com/emmansun/gmsm@v0.29.1/zuc/core_generic.go (about)

     1  //go:build purego || !(amd64 || arm64 || ppc64 || ppc64le)
     2  
     3  package zuc
     4  
     5  func genKeyStream(keyStream []uint32, pState *zucState32) {
     6  	for i := 0; i < len(keyStream); i++ {
     7  		keyStream[i] = pState.genKeyword()
     8  	}
     9  }
    10  
    11  func genKeyword(s *zucState32) uint32 {
    12  	s.bitReorganization()
    13  	z := s.x3 ^ s.f32()
    14  	s.enterWorkMode()
    15  	return z
    16  }