/system/core/include/utils/ |
H A D | JenkinsHash.h | 17 /* Implementation of Jenkins one-at-a-time hash function. These choices are 29 /* The Jenkins hash of a sequence of 32 bit words A, B, C is: 32 inline uint32_t JenkinsHashMix(uint32_t hash, uint32_t data) { argument 33 hash += data; 34 hash += (hash << 10); 35 hash ^= (hash >> 6); 36 return hash; 39 hash_t JenkinsHashWhiten(uint32_t hash); [all...] |
H A D | BasicHashtable.h | 32 // such that at least two entries both hash to this bucket. When true, we 39 // Mask for 30 bits worth of the hash code that are stored within the bucket to 41 // hash code of the entry's key. 45 // a 30 bit hash code. 69 ssize_t find(ssize_t index, hash_t hash, const void* __restrict__ key) const; 70 size_t add(hash_t hash, const void* __restrict__ entry); 119 // Trim a hash code to 30 bits to match what we store in the bucket's cookie. 120 inline static hash_t trimHash(hash_t hash) { argument 121 return (hash & Bucket::HASH_MASK) ^ (hash >> 3 127 chainStart(hash_t hash, size_t count) argument 134 chainIncrement(hash_t hash, size_t count) argument 280 find(ssize_t index, hash_t hash, const TKey& key) const argument 293 add(hash_t hash, const TEntry& entry) argument [all...] |
H A D | LruCache.h | 123 hash_t hash = hash_type(key); local 124 ssize_t index = mTable->find(-1, hash, key); 140 hash_t hash = hash_type(key); local 141 ssize_t index = mTable->find(-1, hash, key); 151 index = mTable->add(hash, initEntry); 159 hash_t hash = hash_type(key); local 160 ssize_t index = mTable->find(-1, hash, key);
|
/system/core/libutils/ |
H A D | JenkinsHash.cpp | 17 /* Implementation of Jenkins one-at-a-time hash function. These choices are 26 hash_t JenkinsHashWhiten(uint32_t hash) { argument 27 hash += (hash << 3); 28 hash ^= (hash >> 11); 29 hash += (hash << 15); 30 return hash; 33 uint32_t JenkinsHashMixBytes(uint32_t hash, cons argument 49 JenkinsHashMixShorts(uint32_t hash, const uint16_t* shorts, size_t size) argument [all...] |
H A D | BasicHashtable.cpp | 113 ssize_t BasicHashtableImpl::find(ssize_t index, hash_t hash, argument 119 hash = trimHash(hash); 121 index = chainStart(hash, mBucketCount); 135 size_t inc = chainIncrement(hash, mBucketCount); 141 if ((bucket.cookie & Bucket::HASH_MASK) == hash 152 size_t BasicHashtableImpl::add(hash_t hash, const void* entry) { argument 159 hash = trimHash(hash); 161 size_t index = chainStart(hash, mBucketCoun 217 hash_t hash = fromBucket.cookie & Bucket::HASH_MASK; local [all...] |
/system/core/libcutils/ |
H A D | hashmap.c | 29 int hash; member in struct:Entry 37 int (*hash)(void* key); member in struct:Hashmap 44 int (*hash)(void* key), bool (*equals)(void* keyA, void* keyB)) { 45 assert(hash != NULL); 69 map->hash = hash; 81 int h = map->hash(key); 97 static inline size_t calculateIndex(size_t bucketCount, int hash) { argument 98 return ((size_t) hash) & (bucketCount - 1); 118 size_t index = calculateIndex(newBucketCount, entry->hash); 166 createEntry(void* key, int hash, void* value) argument 190 int hash = hashKey(map, key); local 222 int hash = hashKey(map, key); local 237 int hash = hashKey(map, key); local 253 int hash = hashKey(map, key); local 285 int hash = hashKey(map, key); local [all...] |
H A D | str_parms.c | 43 /* use djb hash unless we find it inadequate */ 46 uint32_t hash = 5381; local 50 hash = ((hash << 5) + hash) + *p; 51 return (int)hash;
|
/system/core/include/mincrypt/ |
H A D | rsa.h | 51 const uint8_t* hash,
|
H A D | hash-internal.h | 19 const uint8_t* (* const hash)(const void*, int, uint8_t*); member in struct:HASH_VTAB 33 #define HASH_hash(data, len, digest) (ctx)->f->hash(data, len, digest)
|
/system/core/libmincrypt/test/ |
H A D | rsa_test.c | 796 unsigned char hash[SHA_DIGEST_SIZE]; local 805 SHA_hash(message, mlen, hash); \ 807 int result = RSA_verify(&key_15, signature, slen, hash, sizeof(hash)); \
|
/system/extras/ext4_utils/ |
H A D | contents.c | 333 __u32 hash = 0; local 338 hash = (hash << NAME_HASH_SHIFT) ^ 339 (hash >> (8*sizeof(hash) - NAME_HASH_SHIFT)) ^ 348 hash = (hash << VALUE_HASH_SHIFT) ^ 349 (hash >> (8*sizeof(hash) - VALUE_HASH_SHIFT)) ^ 353 entry->e_hash = cpu_to_le32(hash); [all...] |
/system/extras/ksmutils/ |
H A D | ksminfo.c | 47 uint32_t hash; member in struct:ksm_page 202 uint32_t hash; local 259 hash = hashword(data, pm_kernel_pagesize(ker) / sizeof(*data), 17); 262 if (kp->pages[k].hash == hash) break; 285 kp->pages[kp->len].hash = hash; 352 printf("KSM CRC 0x%08x:", kp->pages[i].hash);
|
/system/core/include/cutils/ |
H A D | hashmap.h | 31 /** A hash map. */ 35 * Creates a new hash map. Returns NULL if memory allocation fails. 38 * @param hash function which hashes keys 42 int (*hash)(void* key), bool (*equals)(void* keyA, void* keyB)); 45 * Frees the hash map. Does not free the keys or values themselves. 51 * implementing hash functions. 109 * Locks the hash map so only the current thread can access it. 114 * Unlocks the hash map so other threads can access it.
|
/system/core/init/ |
H A D | init.h | 44 unsigned hash; member in struct:action
|
/system/core/libmincrypt/ |
H A D | rsa.c | 183 // 20 bytes of hash go here. 189 // At the location of the bytes of the hash all 00 are hashed. 227 // 32 bytes of hash go here. 234 // At the location of the bytes of the hash all 00 are hashed. 242 // Verify a 2048-bit RSA PKCS1.5 signature against an expected hash. 244 // SHA_DIGEST_SIZE (== 20) to indicate a SHA-1 hash, or 245 // SHA256_DIGEST_SIZE (== 32) to indicate a SHA-256 hash. No other 252 const uint8_t *hash, 268 return 0; // Unsupported hash. 283 buf[i] ^= *hash 249 RSA_verify(const RSAPublicKey *key, const uint8_t *signature, const int len, const uint8_t *hash, const int hash_len) argument [all...] |
/system/core/libutils/tests/ |
H A D | BasicHashtable_test.cpp | 108 bool* collision, bool* present, hash_t* hash) { 112 *hash = cookie & BasicHashtable<TKey, TEntry>::Bucket::HASH_MASK; 163 hash_t hash; local 164 BasicHashtableTest::cookieAt(h, i, &collision, &present, &hash); 168 ALOGD(" [%3u] = collision=%d, present=%d, hash=0x%08x, key=%3d, value=%3d, " 170 i, collision, present, hash, key, value, hash_type(key)); 107 cookieAt(const BasicHashtable<TKey, TEntry>& h, size_t index, bool* collision, bool* present, hash_t* hash) argument
|