You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Requested feature: byte-by-byte object comparison API
Use case: Compare and check whether two objects pointed by two pointers have the same value byte-by-byte up till a specific size. Something like:
Another example is to compare an aligned and intentionally unaligned pointer to see if they point to the same sequence of n bytes:
// aligned_ptr is *const u8, unaligned_ptr is *const usize, both pointing to the same array of u8 elementslet result = kani::compare_byte_by_byte(aligned_ptr, unaligned_ptr as*constu8, mem::size_of<usize>);
As @celinval explained to me, adding a generic API is tricky because of padding bytes. So, the comparison will likely have to implemented for specific types in which we can guarantee a UB-free comparison.
Requested feature: byte-by-byte object comparison API
Use case: Compare and check whether two objects pointed by two pointers have the same value byte-by-byte up till a specific size. Something like:
For example, we want to compare the result with the data that was passed in:
Another example is to compare an aligned and intentionally unaligned pointer to see if they point to the same sequence of n bytes:
@zhassan-aws
The text was updated successfully, but these errors were encountered: