File: uint64_pack.c

package info (click to toggle)
dq 20230101-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,020 kB
  • sloc: ansic: 8,269; makefile: 363; sh: 176; python: 82
file content (11 lines) | stat: -rw-r--r-- 261 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
#include "uint64_pack.h"

/*
The 'uint64_pack' function converts 64-bit unsigned
integer into 8 bytes stored in little-endian format
*/
void uint64_pack(unsigned char *y, crypto_uint64 x) {

    long long i;
    for (i = 0; i < 8; ++i) { y[i] = x; x >>= 8; }
}