File: uint32_unpack_big.c

package info (click to toggle)
tinyssh 20230101-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,244 kB
  • sloc: ansic: 12,106; sh: 1,168; python: 479; makefile: 42
file content (14 lines) | stat: -rw-r--r-- 306 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "uint32_unpack_big.h"

/*
The 'uint32_unpack_big' function converts 4 bytes
in big-endian format into 32-bit unsigned integer.
*/
crypto_uint32 uint32_unpack_big(const unsigned char *x) {

    crypto_uint32 y = 0;
    long long i;

    for (i = 0; i < 4; ++i) y = (y << 8) | x[i];
    return y;
}