rand_poly initial setup
This commit is contained in:
19
tests/test_util.c
Normal file
19
tests/test_util.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include "test_util.h"
|
||||
|
||||
|
||||
void rand_poly(NtruIntPoly *a, uint16_t N, uint16_t modulus){
|
||||
uint16_t i;
|
||||
int16_t coeffs[N];
|
||||
// int16_t coeffs;
|
||||
a->N = N;
|
||||
printf("-> ");
|
||||
for (i=0; i<N; i++){
|
||||
a->coeffs[i] = random() % modulus;
|
||||
printf("%d %d\n ", i+1, coeffs[i] );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user