diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mdso/mdso.h | 4 | ||||
-rw-r--r-- | include/mdso/mdso_crc32.h | 73 | ||||
-rw-r--r-- | include/mdso/mdso_crc64.h | 73 |
3 files changed, 150 insertions, 0 deletions
diff --git a/include/mdso/mdso.h b/include/mdso/mdso.h index 4b5f24d..14a5817 100644 --- a/include/mdso/mdso.h +++ b/include/mdso/mdso.h @@ -81,6 +81,10 @@ mdso_api int mdso_unmap_input (struct mdso_input *); /* utility api */ +/* low-level api */ +mdso_api uint32_t mdso_crc32_mbstr (const unsigned char * str, size_t * symlen); +mdso_api uint64_t mdso_crc64_mbstr (const unsigned char * str, size_t * symlen); + #ifdef __cplusplus } #endif diff --git a/include/mdso/mdso_crc32.h b/include/mdso/mdso_crc32.h new file mode 100644 index 0000000..3fd509b --- /dev/null +++ b/include/mdso/mdso_crc32.h @@ -0,0 +1,73 @@ +#ifndef MDSO_CRC32_H +#define MDSO_CRC32_H + +#define MDSO_CRC32_POLY 0xd35a6b40 + +#define MDSO_CRC32_TABLE { \ + 0x00000000, 0xd2fcdf96, 0x034d69ad, 0xd1b1b63b, \ + 0x069ad35a, 0xd4660ccc, 0x05d7baf7, 0xd72b6561, \ + 0x0d35a6b4, 0xdfc97922, 0x0e78cf19, 0xdc84108f, \ + 0x0baf75ee, 0xd953aa78, 0x08e21c43, 0xda1ec3d5, \ + 0x1a6b4d68, 0xc89792fe, 0x192624c5, 0xcbdafb53, \ + 0x1cf19e32, 0xce0d41a4, 0x1fbcf79f, 0xcd402809, \ + 0x175eebdc, 0xc5a2344a, 0x14138271, 0xc6ef5de7, \ + 0x11c43886, 0xc338e710, 0x1289512b, 0xc0758ebd, \ + 0x34d69ad0, 0xe62a4546, 0x379bf37d, 0xe5672ceb, \ + 0x324c498a, 0xe0b0961c, 0x31012027, 0xe3fdffb1, \ + 0x39e33c64, 0xeb1fe3f2, 0x3aae55c9, 0xe8528a5f, \ + 0x3f79ef3e, 0xed8530a8, 0x3c348693, 0xeec85905, \ + 0x2ebdd7b8, 0xfc41082e, 0x2df0be15, 0xff0c6183, \ + 0x282704e2, 0xfadbdb74, 0x2b6a6d4f, 0xf996b2d9, \ + 0x2388710c, 0xf174ae9a, 0x20c518a1, 0xf239c737, \ + 0x2512a256, 0xf7ee7dc0, 0x265fcbfb, 0xf4a3146d, \ + 0x69ad35a0, 0xbb51ea36, 0x6ae05c0d, 0xb81c839b, \ + 0x6f37e6fa, 0xbdcb396c, 0x6c7a8f57, 0xbe8650c1, \ + 0x64989314, 0xb6644c82, 0x67d5fab9, 0xb529252f, \ + 0x6202404e, 0xb0fe9fd8, 0x614f29e3, 0xb3b3f675, \ + 0x73c678c8, 0xa13aa75e, 0x708b1165, 0xa277cef3, \ + 0x755cab92, 0xa7a07404, 0x7611c23f, 0xa4ed1da9, \ + 0x7ef3de7c, 0xac0f01ea, 0x7dbeb7d1, 0xaf426847, \ + 0x78690d26, 0xaa95d2b0, 0x7b24648b, 0xa9d8bb1d, \ + 0x5d7baf70, 0x8f8770e6, 0x5e36c6dd, 0x8cca194b, \ + 0x5be17c2a, 0x891da3bc, 0x58ac1587, 0x8a50ca11, \ + 0x504e09c4, 0x82b2d652, 0x53036069, 0x81ffbfff, \ + 0x56d4da9e, 0x84280508, 0x5599b333, 0x87656ca5, \ + 0x4710e218, 0x95ec3d8e, 0x445d8bb5, 0x96a15423, \ + 0x418a3142, 0x9376eed4, 0x42c758ef, 0x903b8779, \ + 0x4a2544ac, 0x98d99b3a, 0x49682d01, 0x9b94f297, \ + 0x4cbf97f6, 0x9e434860, 0x4ff2fe5b, 0x9d0e21cd, \ + 0xd35a6b40, 0x01a6b4d6, 0xd01702ed, 0x02ebdd7b, \ + 0xd5c0b81a, 0x073c678c, 0xd68dd1b7, 0x04710e21, \ + 0xde6fcdf4, 0x0c931262, 0xdd22a459, 0x0fde7bcf, \ + 0xd8f51eae, 0x0a09c138, 0xdbb87703, 0x0944a895, \ + 0xc9312628, 0x1bcdf9be, 0xca7c4f85, 0x18809013, \ + 0xcfabf572, 0x1d572ae4, 0xcce69cdf, 0x1e1a4349, \ + 0xc404809c, 0x16f85f0a, 0xc749e931, 0x15b536a7, \ + 0xc29e53c6, 0x10628c50, 0xc1d33a6b, 0x132fe5fd, \ + 0xe78cf190, 0x35702e06, 0xe4c1983d, 0x363d47ab, \ + 0xe11622ca, 0x33eafd5c, 0xe25b4b67, 0x30a794f1, \ + 0xeab95724, 0x384588b2, 0xe9f43e89, 0x3b08e11f, \ + 0xec23847e, 0x3edf5be8, 0xef6eedd3, 0x3d923245, \ + 0xfde7bcf8, 0x2f1b636e, 0xfeaad555, 0x2c560ac3, \ + 0xfb7d6fa2, 0x2981b034, 0xf830060f, 0x2accd999, \ + 0xf0d21a4c, 0x222ec5da, 0xf39f73e1, 0x2163ac77, \ + 0xf648c916, 0x24b41680, 0xf505a0bb, 0x27f97f2d, \ + 0xbaf75ee0, 0x680b8176, 0xb9ba374d, 0x6b46e8db, \ + 0xbc6d8dba, 0x6e91522c, 0xbf20e417, 0x6ddc3b81, \ + 0xb7c2f854, 0x653e27c2, 0xb48f91f9, 0x66734e6f, \ + 0xb1582b0e, 0x63a4f498, 0xb21542a3, 0x60e99d35, \ + 0xa09c1388, 0x7260cc1e, 0xa3d17a25, 0x712da5b3, \ + 0xa606c0d2, 0x74fa1f44, 0xa54ba97f, 0x77b776e9, \ + 0xada9b53c, 0x7f556aaa, 0xaee4dc91, 0x7c180307, \ + 0xab336666, 0x79cfb9f0, 0xa87e0fcb, 0x7a82d05d, \ + 0x8e21c430, 0x5cdd1ba6, 0x8d6cad9d, 0x5f90720b, \ + 0x88bb176a, 0x5a47c8fc, 0x8bf67ec7, 0x590aa151, \ + 0x83146284, 0x51e8bd12, 0x80590b29, 0x52a5d4bf, \ + 0x858eb1de, 0x57726e48, 0x86c3d873, 0x543f07e5, \ + 0x944a8958, 0x46b656ce, 0x9707e0f5, 0x45fb3f63, \ + 0x92d05a02, 0x402c8594, 0x919d33af, 0x4361ec39, \ + 0x997f2fec, 0x4b83f07a, 0x9a324641, 0x48ce99d7, \ + 0x9fe5fcb6, 0x4d192320, 0x9ca8951b, 0x4e544a8d \ +} + +#endif diff --git a/include/mdso/mdso_crc64.h b/include/mdso/mdso_crc64.h new file mode 100644 index 0000000..5ab2fc5 --- /dev/null +++ b/include/mdso/mdso_crc64.h @@ -0,0 +1,73 @@ +#ifndef MDSO_CRC64_H +#define MDSO_CRC64_H + +#define MDSO_CRC64_POLY 0xd56ca934d35a6b40 + +#define MDSO_CRC64_TABLE { \ + 0x0000000000000000, 0xd4c67066bafcdf96, 0x0355b2a4d34d69ad, 0xd793c2c269b1b63b, \ + 0x06ab6549a69ad35a, 0xd26d152f1c660ccc, 0x05fed7ed75d7baf7, 0xd138a78bcf2b6561, \ + 0x0d56ca934d35a6b4, 0xd990baf5f7c97922, 0x0e0378379e78cf19, 0xdac508512484108f, \ + 0x0bfdafdaebaf75ee, 0xdf3bdfbc5153aa78, 0x08a81d7e38e21c43, 0xdc6e6d18821ec3d5, \ + 0x1aad95269a6b4d68, 0xce6be540209792fe, 0x19f82782492624c5, 0xcd3e57e4f3dafb53, \ + 0x1c06f06f3cf19e32, 0xc8c08009860d41a4, 0x1f5342cbefbcf79f, 0xcb9532ad55402809, \ + 0x17fb5fb5d75eebdc, 0xc33d2fd36da2344a, 0x14aeed1104138271, 0xc0689d77beef5de7, \ + 0x11503afc71c43886, 0xc5964a9acb38e710, 0x12058858a289512b, 0xc6c3f83e18758ebd, \ + 0x355b2a4d34d69ad0, 0xe19d5a2b8e2a4546, 0x360e98e9e79bf37d, 0xe2c8e88f5d672ceb, \ + 0x33f04f04924c498a, 0xe7363f6228b0961c, 0x30a5fda041012027, 0xe4638dc6fbfdffb1, \ + 0x380de0de79e33c64, 0xeccb90b8c31fe3f2, 0x3b58527aaaae55c9, 0xef9e221c10528a5f, \ + 0x3ea68597df79ef3e, 0xea60f5f1658530a8, 0x3df337330c348693, 0xe9354755b6c85905, \ + 0x2ff6bf6baebdd7b8, 0xfb30cf0d1441082e, 0x2ca30dcf7df0be15, 0xf8657da9c70c6183, \ + 0x295dda22082704e2, 0xfd9baa44b2dbdb74, 0x2a086886db6a6d4f, 0xfece18e06196b2d9, \ + 0x22a075f8e388710c, 0xf666059e5974ae9a, 0x21f5c75c30c518a1, 0xf533b73a8a39c737, \ + 0x240b10b14512a256, 0xf0cd60d7ffee7dc0, 0x275ea215965fcbfb, 0xf398d2732ca3146d, \ + 0x6ab6549a69ad35a0, 0xbe7024fcd351ea36, 0x69e3e63ebae05c0d, 0xbd259658001c839b, \ + 0x6c1d31d3cf37e6fa, 0xb8db41b575cb396c, 0x6f4883771c7a8f57, 0xbb8ef311a68650c1, \ + 0x67e09e0924989314, 0xb326ee6f9e644c82, 0x64b52cadf7d5fab9, 0xb0735ccb4d29252f, \ + 0x614bfb408202404e, 0xb58d8b2638fe9fd8, 0x621e49e4514f29e3, 0xb6d83982ebb3f675, \ + 0x701bc1bcf3c678c8, 0xa4ddb1da493aa75e, 0x734e7318208b1165, 0xa788037e9a77cef3, \ + 0x76b0a4f5555cab92, 0xa276d493efa07404, 0x75e516518611c23f, 0xa12366373ced1da9, \ + 0x7d4d0b2fbef3de7c, 0xa98b7b49040f01ea, 0x7e18b98b6dbeb7d1, 0xaadec9edd7426847, \ + 0x7be66e6618690d26, 0xaf201e00a295d2b0, 0x78b3dcc2cb24648b, 0xac75aca471d8bb1d, \ + 0x5fed7ed75d7baf70, 0x8b2b0eb1e78770e6, 0x5cb8cc738e36c6dd, 0x887ebc1534ca194b, \ + 0x59461b9efbe17c2a, 0x8d806bf8411da3bc, 0x5a13a93a28ac1587, 0x8ed5d95c9250ca11, \ + 0x52bbb444104e09c4, 0x867dc422aab2d652, 0x51ee06e0c3036069, 0x8528768679ffbfff, \ + 0x5410d10db6d4da9e, 0x80d6a16b0c280508, 0x574563a96599b333, 0x838313cfdf656ca5, \ + 0x4540ebf1c710e218, 0x91869b977dec3d8e, 0x46155955145d8bb5, 0x92d32933aea15423, \ + 0x43eb8eb8618a3142, 0x972dfededb76eed4, 0x40be3c1cb2c758ef, 0x94784c7a083b8779, \ + 0x481621628a2544ac, 0x9cd0510430d99b3a, 0x4b4393c659682d01, 0x9f85e3a0e394f297, \ + 0x4ebd442b2cbf97f6, 0x9a7b344d96434860, 0x4de8f68ffff2fe5b, 0x992e86e9450e21cd, \ + 0xd56ca934d35a6b40, 0x01aad95269a6b4d6, 0xd6391b90001702ed, 0x02ff6bf6baebdd7b, \ + 0xd3c7cc7d75c0b81a, 0x0701bc1bcf3c678c, 0xd0927ed9a68dd1b7, 0x04540ebf1c710e21, \ + 0xd83a63a79e6fcdf4, 0x0cfc13c124931262, 0xdb6fd1034d22a459, 0x0fa9a165f7de7bcf, \ + 0xde9106ee38f51eae, 0x0a5776888209c138, 0xddc4b44aebb87703, 0x0902c42c5144a895, \ + 0xcfc13c1249312628, 0x1b074c74f3cdf9be, 0xcc948eb69a7c4f85, 0x1852fed020809013, \ + 0xc96a595befabf572, 0x1dac293d55572ae4, 0xca3febff3ce69cdf, 0x1ef99b99861a4349, \ + 0xc297f6810404809c, 0x165186e7bef85f0a, 0xc1c24425d749e931, 0x150434436db536a7, \ + 0xc43c93c8a29e53c6, 0x10fae3ae18628c50, 0xc769216c71d33a6b, 0x13af510acb2fe5fd, \ + 0xe0378379e78cf190, 0x34f1f31f5d702e06, 0xe36231dd34c1983d, 0x37a441bb8e3d47ab, \ + 0xe69ce630411622ca, 0x325a9656fbeafd5c, 0xe5c95494925b4b67, 0x310f24f228a794f1, \ + 0xed6149eaaab95724, 0x39a7398c104588b2, 0xee34fb4e79f43e89, 0x3af28b28c308e11f, \ + 0xebca2ca30c23847e, 0x3f0c5cc5b6df5be8, 0xe89f9e07df6eedd3, 0x3c59ee6165923245, \ + 0xfa9a165f7de7bcf8, 0x2e5c6639c71b636e, 0xf9cfa4fbaeaad555, 0x2d09d49d14560ac3, \ + 0xfc317316db7d6fa2, 0x28f703706181b034, 0xff64c1b20830060f, 0x2ba2b1d4b2ccd999, \ + 0xf7ccdccc30d21a4c, 0x230aacaa8a2ec5da, 0xf4996e68e39f73e1, 0x205f1e0e5963ac77, \ + 0xf167b9859648c916, 0x25a1c9e32cb41680, 0xf2320b214505a0bb, 0x26f47b47fff97f2d, \ + 0xbfdafdaebaf75ee0, 0x6b1c8dc8000b8176, 0xbc8f4f0a69ba374d, 0x68493f6cd346e8db, \ + 0xb97198e71c6d8dba, 0x6db7e881a691522c, 0xba242a43cf20e417, 0x6ee25a2575dc3b81, \ + 0xb28c373df7c2f854, 0x664a475b4d3e27c2, 0xb1d98599248f91f9, 0x651ff5ff9e734e6f, \ + 0xb427527451582b0e, 0x60e12212eba4f498, 0xb772e0d0821542a3, 0x63b490b638e99d35, \ + 0xa5776888209c1388, 0x71b118ee9a60cc1e, 0xa622da2cf3d17a25, 0x72e4aa4a492da5b3, \ + 0xa3dc0dc18606c0d2, 0x771a7da73cfa1f44, 0xa089bf65554ba97f, 0x744fcf03efb776e9, \ + 0xa821a21b6da9b53c, 0x7ce7d27dd7556aaa, 0xab7410bfbee4dc91, 0x7fb260d904180307, \ + 0xae8ac752cb336666, 0x7a4cb73471cfb9f0, 0xaddf75f6187e0fcb, 0x79190590a282d05d, \ + 0x8a81d7e38e21c430, 0x5e47a78534dd1ba6, 0x89d465475d6cad9d, 0x5d121521e790720b, \ + 0x8c2ab2aa28bb176a, 0x58ecc2cc9247c8fc, 0x8f7f000efbf67ec7, 0x5bb97068410aa151, \ + 0x87d71d70c3146284, 0x53116d1679e8bd12, 0x8482afd410590b29, 0x5044dfb2aaa5d4bf, \ + 0x817c7839658eb1de, 0x55ba085fdf726e48, 0x8229ca9db6c3d873, 0x56efbafb0c3f07e5, \ + 0x902c42c5144a8958, 0x44ea32a3aeb656ce, 0x9379f061c707e0f5, 0x47bf80077dfb3f63, \ + 0x9687278cb2d05a02, 0x424157ea082c8594, 0x95d29528619d33af, 0x4114e54edb61ec39, \ + 0x9d7a8856597f2fec, 0x49bcf830e383f07a, 0x9e2f3af28a324641, 0x4ae94a9430ce99d7, \ + 0x9bd1ed1fffe5fcb6, 0x4f179d7945192320, 0x98845fbb2ca8951b, 0x4c422fdd96544a8d \ +} + +#endif |