Пример #1
0
/**
 * @brief multiply binary matrices with a vector
 */
static uint8_t m_mul(uint8_t *matrix, uint8_t vector, int m_row)
{
    uint8_t temp = 0;
    uint8_t result = 0;
    for (int i = 0; i < m_row; i++) {
        temp = matrix[i] & vector;
        result |= (self_xor(temp) << (m_row - i - 1));
    }
#ifdef MUL_DBG
    binary_print(vector);
    binary_print(result);
#endif
    return result;
}
Пример #2
0
/* Prints a metaentry */
static void
mentry_print(const struct metaentry *mentry)
{
	int i;

	if (!mentry || !mentry->path) {
		msg(MSG_DEBUG,
		    "Incorrect meta entry passed to printmetaentry\n");
		return;
	}

	msg(MSG_DEBUG, "===========================\n");
	msg(MSG_DEBUG, "Dump of metaentry %p\n", mentry);
	msg(MSG_DEBUG, "===========================\n");

	msg(MSG_DEBUG, "path\t\t: %s\n", mentry->path);
	msg(MSG_DEBUG, "owner\t\t: %s\n", mentry->owner);
	msg(MSG_DEBUG, "group\t\t: %s\n", mentry->group);
	msg(MSG_DEBUG, "mtime\t\t: %ld\n", (unsigned long)mentry->mtime);
	msg(MSG_DEBUG, "mtimensec\t: %ld\n", (unsigned long)mentry->mtimensec);
	msg(MSG_DEBUG, "mode\t\t: %ld\n", (unsigned long)mentry->mode);
	for (i = 0; i < mentry->xattrs; i++) {
		msg(MSG_DEBUG, "xattr[%i]\t: %s=\"", i, mentry->xattr_names[i]);
		binary_print(mentry->xattr_values[i], mentry->xattr_lvalues[i]);
		msg(MSG_DEBUG, "\"\n");
	}

	msg(MSG_DEBUG, "===========================\n\n");
}
Пример #3
0
void display_flags(char *label, unsigned int value)
{
  printf("%s\t: %d\t:", label, value);
  binary_print(value);
  printf("\n");
}