Electroneum
random.cpp File Reference
#include "gtest/gtest.h"
#include "crypto/crypto.h"
#include "crypto/crypto-ops.h"
Include dependency graph for random.cpp:

Go to the source code of this file.

Functions

 TEST (random32_unbiased, less_than_order)
 

Function Documentation

◆ TEST()

TEST ( random32_unbiased  ,
less_than_order   
)

Definition at line 37 of file random.cpp.

38 {
39  unsigned char tmp[32], tmp2[32];
40  for (int i = 0; i < 1000; ++i)
41  {
43  memcpy(tmp2, tmp, 32);
44  sc_reduce32(tmp2);
45  ASSERT_EQ(memcmp(tmp, tmp2, 32), 0);
46  }
47 }
void random32_unbiased(unsigned char *bytes)
Definition: crypto.cpp:110
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
void sc_reduce32(unsigned char *)
void * memcpy(void *a, const void *b, size_t c)
Here is the call graph for this function: