File: uint64_unpack.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 (13 lines) | stat: -rw-r--r-- 297 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "uint64_unpack.h"

/*
The 'uint64_unpack' function converts 8 bytes
in little-endian format into 64-bit unsigned integer.
*/
crypto_uint64 uint64_unpack(const unsigned char *x) {

    crypto_uint64 y = 0;
    long long i;
    for (i = 7; i >= 0; --i) y = (y << 8) | x[i];
    return y;
}