// NewWithOPc initializes a new MILENAGE algorithm using OPc instead of OP.
NewWithOPc initializes a new MILENAGE algorithm using OPc instead of OP.
// NewWithOPc initializes a new MILENAGE algorithm using OPc instead of OP .
func NewWithOPc(k, opc, rand []byte, sqn uint64, amf uint16) *Milenage {
	m := &Milenage{
		K:    k,
		OP:   nil,
		OPc:  opc,
		RAND: rand,
		AMF:  make([]byte, 2),
		SQN:  make([]byte, 6),
		MACA: make([]byte, 8),
		MACS: make([]byte, 8),
		RES:  make([]byte, 8),
		CK:   make([]byte, 16),
		IK:   make([]byte, 16),
		AK:   make([]byte, 6),
		AKS:  make([]byte, 6),
	}
	s := make([]byte, 8)
	binary.BigEndian.PutUint64(s, sqn)
	for i := 0; i < 6; i++ {
		m.SQN[i] = s[i+2]
	}
	binary.BigEndian.PutUint16(m.AMF, amf)
	return m
}
func NewWithOPc ( k , opc , rand [ ] byte , sqn uint64 , amf uint16 ) * Milenage { m := & Milenage { K : k , OP : nil , OPc : opc , RAND : rand , AMF : make ( [ ] byte , 2 ) , SQN : make ( [ ] byte , 6 ) , MACA : make ( [ ] byte , 8 ) , MACS : make ( [ ] byte , 8 ) , RES : make ( [ ] byte , 8 ) , CK : make ( [ ] byte , 16 ) , IK : make ( [ ] byte , 16 ) , AK : make ( [ ] byte , 6 ) , AKS : make ( [ ] byte , 6 ) , } s := make ( [ ] byte , 8 ) binary . BigEndian . PutUint64 ( s , sqn ) for i := 0 ; i < 6 ; i ++ { m . SQN [ i ] = s [ i + 2 ] } binary . BigEndian . PutUint16 ( m . AMF , amf ) return m }
NewWithOPc initializes a new MILENAGE algorithm using OPc instead of OP.
NewWithOPc initializes a new MILENAGE algorithm using OPc instead of OP .