Lines Matching defs:context

73     public function wrap(string $data, SaslContext $context): string
75 $qop = $context->get('qop');
78 $wrapped = $this->encrypt($data, $context);
80 $wrapped = $this->sign($data, $context);
84 $this->validateBufferLength($wrapped, $context);
85 $context->set('seqnumsnt', $context->get('seqnumsnt') + 1);
93 public function unwrap(string $data, SaslContext $context): string
95 $qop = $context->get('qop');
96 $this->validateBufferLength($data, $context);
99 $unwrapped = $this->decrypt($data, $context);
101 $unwrapped = $this->verify($data, $context);
105 $context->set('seqnumrcv', $context->get('seqnumrcv') + 1);
113 protected function decrypt(string $data, SaslContext $context): string
127 $seqnum = $context->get('seqnumrcv');
136 $cipher = $context->get('cipher');
137 $a1 = $context->get('a1');
138 $isServerMode = $context->isServerMode();
172 protected function encrypt(string $data, SaslContext $context): string
174 $cipher = $context->get('cipher');
175 $a1 = $context->get('a1');
176 $isServerMode = $context->isServerMode();
177 $seqnum = $context->get('seqnumsnt');
237 protected function sign(string $message, SaslContext $context): string
239 $seqnum = $context->get('seqnumsnt');
240 $mc = $context->isServerMode() ? self::KIS_MC : self::KIC_MC;
241 $ki = $this->generateKeyKi($context->get('a1'), $mc);
252 protected function verify(string $data, SaslContext $context): string
259 $seqnum = $context->get('seqnumrcv');
262 $mc = $context->isServerMode() ? self::KIC_MC : self::KIS_MC;
263 $ki = $this->generateKeyKi($context->get('a1'), $mc);
389 protected function validateBufferLength(string $data, SaslContext $context): void
391 $maxbuf = $context->has('maxbuf') ? (int) $context->get('maxbuf') : self::MAXBUF;