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

/*
The 'uint32_pack_big' function converts 32-bit unsigned
integer into 4 bytes stored in big-endian format
*/
void uint32_pack_big(unsigned char *y, crypto_uint32 x) {

    long long i;

    for (i = 3; i >= 0; --i) { y[i] = x; x >>= 8; }
}