Home | History | Annotate | Download | only in wps

Lines Matching refs:pin

202  * wps_pin_checksum - Compute PIN checksum
203 * @pin: Seven digit PIN (i.e., eight digit PIN without the checksum digit)
206 unsigned int wps_pin_checksum(unsigned int pin)
209 while (pin) {
210 accum += 3 * (pin % 10);
211 pin /= 10;
212 accum += pin % 10;
213 pin /= 10;
221 * wps_pin_valid - Check whether a PIN has a valid checksum
222 * @pin: Eight digit PIN (i.e., including the checksum digit)
225 unsigned int wps_pin_valid(unsigned int pin)
227 return wps_pin_checksum(pin / 10) == (pin % 10);
232 * wps_generate_pin - Generate a random PIN
233 * Returns: Eight digit PIN (i.e., including the checksum digit)
239 /* Generate seven random digits for the PIN */
252 int wps_pin_str_valid(const char *pin)
257 p = pin;
263 len = p - pin;