... uint8_t index[16]; // 128bit unsigned integer uintx_init(index, 128U); // Initialize 128bit index to zero. uintx_inc(index, 128U); // Increment Index (Now is One) uintx_dec(index, 128U); // Decrement Index (Now is Zero) uintx_from_u64(index, 128U, 8192U); // Now index is 8192 uintx_add64(index, 128U, 5U); // Add 5 to index uintx_compare(index, 128U, 8197U); // Return 0 uintx_compare(index, 128U, 9197U); // Return -1 uintx_compare(index, 128U, 0U); // Return 1 ...
The API is quite simple pass your object (uint8_t vector) and its bit size (uint8_t[16] is 128bit) and other args needed to the method. Of course you can replace 128 with 256, 512 or everything else.
The source code can be found at my GitHub in the uintx folder:
http://github.com/matteobertozzi/carthage.git
No comments:
Post a Comment