Lines Matching defs:hash
35 int otp_read_hex(const char *data, const char **endptr, unsigned char *hash)
45 buffer_create_from_data(&buf, hash, OTP_HASH_SIZE);
77 int otp_read_words(const char *data, const char **endptr, unsigned char *hash)
133 hash[0] = bits[0] >> 3;
134 hash[1] = ((bits[0] & 7) << 5) | (bits[1] >> 6);
135 hash[2] = ((bits[1] & 0x3f) << 2) | (bits[2] >> 9);
136 hash[3] = (bits[2] >> 1) & 0xff;
137 hash[4] = ((bits[2] & 3) << 7) | (bits[3] >> 4);
138 hash[5] = ((bits[3] & 15) << 4) | (bits[4] >> 7);
139 hash[6] = ((bits[4] & 0x7f) << 1) | (bits[5] >> 10);
140 hash[7] = (bits[5] >> 2) & 0xff;
143 return otp_parity(hash) != parity ? 1 : 0;
177 int otp_parse_response(const char *data, unsigned char *hash, bool hex)
180 int ret = hex ? otp_read_hex(data, &end, hash) :
181 otp_read_words(data, &end, hash);
189 unsigned char *hash, bool hex, const char **error)
192 int ret = hex ? otp_read_hex(data, &end, hash) :
193 otp_read_words(data, &end, hash);
217 ret = hex ? otp_read_hex(end, &end, new_state->hash) :
218 otp_read_words(end, &end, new_state->hash);
244 return otp_read_hex(end, &end, state->hash);
251 binary_to_hex(state->hash, 8));