… | |
… | |
430 | |
430 | |
431 | =item uint32_t ecb_bswap16 (uint32_t x) |
431 | =item uint32_t ecb_bswap16 (uint32_t x) |
432 | |
432 | |
433 | =item uint32_t ecb_bswap32 (uint32_t x) |
433 | =item uint32_t ecb_bswap32 (uint32_t x) |
434 | |
434 | |
|
|
435 | =item uint64_t ecb_bswap64 (uint64_t x) |
|
|
436 | |
435 | These two functions return the value of the 16-bit (32-bit) value C<x> |
437 | These functions return the value of the 16-bit (32-bit, 64-bit) value |
436 | after reversing the order of bytes (0x11223344 becomes 0x44332211). |
438 | C<x> after reversing the order of bytes (0x11223344 becomes 0x44332211 in |
|
|
439 | C<ecb_bswap32>). |
|
|
440 | |
|
|
441 | =item uint8_t ecb_rotl8 (uint8_t x, unsigned int count) |
|
|
442 | |
|
|
443 | =item uint16_t ecb_rotl16 (uint16_t x, unsigned int count) |
|
|
444 | |
|
|
445 | =item uint32_t ecb_rotl32 (uint32_t x, unsigned int count) |
|
|
446 | |
|
|
447 | =item uint64_t ecb_rotl64 (uint64_t x, unsigned int count) |
|
|
448 | |
|
|
449 | =item uint8_t ecb_rotr8 (uint8_t x, unsigned int count) |
|
|
450 | |
|
|
451 | =item uint16_t ecb_rotr16 (uint16_t x, unsigned int count) |
437 | |
452 | |
438 | =item uint32_t ecb_rotr32 (uint32_t x, unsigned int count) |
453 | =item uint32_t ecb_rotr32 (uint32_t x, unsigned int count) |
439 | |
454 | |
440 | =item uint32_t ecb_rotl32 (uint32_t x, unsigned int count) |
|
|
441 | |
|
|
442 | =item uint64_t ecb_rotr64 (uint64_t x, unsigned int count) |
455 | =item uint64_t ecb_rotr64 (uint64_t x, unsigned int count) |
443 | |
456 | |
444 | =item uint64_t ecb_rotl64 (uint64_t x, unsigned int count) |
|
|
445 | |
|
|
446 | These two functions return the value of C<x> after rotating all the bits |
457 | These two families of functions return the value of C<x> after rotating |
447 | by C<count> positions to the right or left respectively. |
458 | all the bits by C<count> positions to the right (C<ecb_rotr>) or left |
|
|
459 | (C<ecb_rotl>). |
448 | |
460 | |
449 | Current GCC versions understand these functions and usually compile them |
461 | Current GCC versions understand these functions and usually compile them |
450 | to "optimal" code (e.g. a single C<roll> on x86). |
462 | to "optimal" code (e.g. a single C<rol> or a combination of C<shld> on |
|
|
463 | x86). |
451 | |
464 | |
452 | =back |
465 | =back |
453 | |
466 | |
454 | =head2 ARITHMETIC |
467 | =head2 ARITHMETIC |
455 | |
468 | |