Lines Matching refs:pin
205 * wps_pin_checksum - Compute PIN checksum
206 * @pin: Seven digit PIN (i.e., eight digit PIN without the checksum digit)
209 unsigned int wps_pin_checksum(unsigned int pin)
212 while (pin) {
213 accum += 3 * (pin % 10);
214 pin /= 10;
215 accum += pin % 10;
216 pin /= 10;
224 * wps_pin_valid - Check whether a PIN has a valid checksum
225 * @pin: Eight digit PIN (i.e., including the checksum digit)
228 unsigned int wps_pin_valid(unsigned int pin)
230 return wps_pin_checksum(pin / 10) == (pin % 10);
235 * wps_generate_pin - Generate a random PIN
236 * Returns: Eight digit PIN (i.e., including the checksum digit)
238 int wps_generate_pin(unsigned int *pin)
242 /* Generate seven random digits for the PIN */
248 *pin = val * 10 + wps_pin_checksum(val);
253 int wps_pin_str_valid(const char *pin)
258 p = pin;
264 len = p - pin;