File: uint32_pack.c

package info (click to toggle)
tinyssh 20190101-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,208 kB
  • sloc: ansic: 11,914; sh: 1,005; python: 385; makefile: 18
file content (11 lines) | stat: -rw-r--r-- 261 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
#include "uint32_pack.h"

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

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