// computeOPc computes OPc from K and OP inside m.
computeOPc computes OPc from K and OP inside m.
// computeOPc computes OPc from K and OP inside m .
func (m *Milenage) computeOPc() error {
	m.OPc = make([]byte, 16)
	block, err := aes.NewCipher(m.K)
	if err != nil {
		return err
	}
	cipherText := make([]byte, len(m.OP))
	block.Encrypt(cipherText, m.OP)
	bytes := xor(cipherText, m.OP)
	for i, b := range bytes {
		if i > len(m.OPc) {
			break
		}
		m.OPc[i] = b
	}
	return nil
}
func ( m * Milenage ) computeOPc ( ) error { m . OPc = make ( [ ] byte , 16 ) block , err := aes . NewCipher ( m . K ) if err != nil { return err } cipherText := make ( [ ] byte , len ( m . OP ) ) block . Encrypt ( cipherText , m . OP ) bytes := xor ( cipherText , m . OP ) for i , b := range bytes { if i > len ( m . OPc ) { break } m . OPc [ i ] = b } return nil }
computeOPc computes OPc from K and OP inside m.
computeOPc computes OPc from K and OP inside m .