#include "crypto_encode_953x2115.h" /* auto-generated; do not edit */ #define int16 int16_t #define uint16 uint16_t #define uint32 uint32_t void PQCLEAN_NTRULPR953_CLEAN_crypto_encode_953x2115(unsigned char *out, const void *v) { const int16 *R0 = v; /* XXX: caller could overlap R with input */ uint16 R[477]; long i; uint16 r0, r1; uint32 r2; for (i = 0; i < 476; ++i) { r0 = (uint16) ((((R0[2 * i] + 3171) & 16383) * 10923) >> 15); r1 = (uint16) ((((R0[2 * i + 1] + 3171) & 16383) * 10923) >> 15); r2 = r0 + r1 * (uint32)2115; *out++ = (unsigned char) r2; r2 >>= 8; *out++ = (unsigned char) r2; r2 >>= 8; R[i] = (uint16) r2; } R[476] = (uint16) ((((R0[952] + 3171) & 16383) * 10923) >> 15); for (i = 0; i < 238; ++i) { r0 = R[2 * i]; r1 = R[2 * i + 1]; r2 = r0 + r1 * (uint32)69; R[i] = (uint16) r2; } R[238] = R[476]; for (i = 0; i < 119; ++i) { r0 = R[2 * i]; r1 = R[2 * i + 1]; r2 = r0 + r1 * (uint32)4761; *out++ = (unsigned char) r2; r2 >>= 8; *out++ = (unsigned char) r2; r2 >>= 8; R[i] = (uint16) r2; } R[119] = R[238]; for (i = 0; i < 60; ++i) { r0 = R[2 * i]; r1 = R[2 * i + 1]; r2 = r0 + r1 * (uint32)346; *out++ = (unsigned char) r2; r2 >>= 8; R[i] = (uint16) r2; } for (i = 0; i < 30; ++i) { r0 = R[2 * i]; r1 = R[2 * i + 1]; r2 = r0 + r1 * (uint32)468; *out++ = (unsigned char) r2; r2 >>= 8; R[i] = (uint16) r2; } for (i = 0; i < 14; ++i) { r0 = R[2 * i]; r1 = R[2 * i + 1]; r2 = r0 + r1 * (uint32)856; *out++ = (unsigned char) r2; r2 >>= 8; R[i] = (uint16) r2; } r0 = R[28]; r1 = R[29]; r2 = r0 + r1 * (uint32)856; *out++ = (unsigned char) r2; r2 >>= 8; *out++ = (unsigned char) r2; r2 >>= 8; R[14] = (uint16) r2; for (i = 0; i < 7; ++i) { r0 = R[2 * i]; r1 = R[2 * i + 1]; r2 = r0 + r1 * (uint32)2863; *out++ = (unsigned char) r2; r2 >>= 8; *out++ = (unsigned char) r2; r2 >>= 8; R[i] = (uint16) r2; } R[7] = R[14]; for (i = 0; i < 4; ++i) { r0 = R[2 * i]; r1 = R[2 * i + 1]; r2 = r0 + r1 * (uint32)126; R[i] = (uint16) r2; } for (i = 0; i < 2; ++i) { r0 = R[2 * i]; r1 = R[2 * i + 1]; r2 = r0 + r1 * (uint32)15876; *out++ = (unsigned char) r2; r2 >>= 8; *out++ = (unsigned char) r2; r2 >>= 8; R[i] = (uint16) r2; } r0 = R[0]; r1 = R[1]; r2 = r0 + r1 * (uint32)3846; *out++ = (unsigned char) r2; r2 >>= 8; *out++ = (unsigned char) r2; r2 >>= 8; R[0] = (uint16) r2; r0 = R[0]; *out++ = (unsigned char) r0; }