ObjFW  Diff

Differences From Artifact [5b6730706a]:

To Artifact [91b9317d21]:

  • File src/OFMapTable.h — part of check-in [4857107479] at 2012-12-06 11:00:54 on branch trunk — OFMapTable: Rotate hash by a random number of bits

    By rotating the hash by a random number of bits, an attacker needs to
    find collisions on the full 32 bits of the hash and not only on the
    lower n bits that are actually used by the map table, as an attacker
    can't know which bits are actually used for the map table. (user: js, size: 7246) [annotate] [blame] [check-ins using]


47
48
49
50
51
52
53

54
55
56
57
58
59
60
@interface OFMapTable: OFObject <OFCopying, OFFastEnumeration>
{
	of_map_table_functions_t keyFunctions, valueFunctions;
	struct of_map_table_bucket **buckets;
	uint32_t minCapacity, capacity, count;
	unsigned long mutations;
	uint32_t seed;

}

/*!
 * @brief Creates a new OFMapTable with the specified key and value functions.
 *
 * @param keyFunctions A structure of functions for handling keys
 * @param valueFunctions A structure of functions for handling values







>







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@interface OFMapTable: OFObject <OFCopying, OFFastEnumeration>
{
	of_map_table_functions_t keyFunctions, valueFunctions;
	struct of_map_table_bucket **buckets;
	uint32_t minCapacity, capacity, count;
	unsigned long mutations;
	uint32_t seed;
	uint8_t rotate;
}

/*!
 * @brief Creates a new OFMapTable with the specified key and value functions.
 *
 * @param keyFunctions A structure of functions for handling keys
 * @param valueFunctions A structure of functions for handling values