crypto_nPbatch/montgomery25519/amd64-avx2-4x1-9l-mxaa/fe25519_pack.c
raw| 1 | // linker define fe25519_pack |
| 2 | // linker use fe25519_freeze |
| 3 | |
| 4 | #include "fe25519.h" |
| 5 | |
| 6 | /* Assumes input x being reduced below 2^255 */ |
| 7 | void fe25519_pack(unsigned char r[32], const fe25519 *x) |
| 8 | { |
| 9 | int i; |
| 10 | fe25519 t; |
| 11 | t = *x; |
| 12 | fe25519_freeze(&t); |
| 13 | /* assuming little-endian */ |
| 14 | for(i=0;i<32;i++) r[i] = i[(unsigned char *)&t.l]; |
| 15 | } |
| 16 |