From 412a8f99928beff605805807b0f07f6bf8d0a965 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Fri, 13 May 2022 12:45:53 +0200 Subject: code rename --- fw/fe310/eos/rng.c | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 fw/fe310/eos/rng.c (limited to 'fw/fe310/eos/rng.c') diff --git a/fw/fe310/eos/rng.c b/fw/fe310/eos/rng.c deleted file mode 100644 index 317941d..0000000 --- a/fw/fe310/eos/rng.c +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -#include - -#include "net.h" - -int getentropy(unsigned char *b, size_t sz) { - unsigned char type; - unsigned char *buffer; - uint16_t len; - int rv; - - buffer = eos_net_alloc(); - - type = EOS_NET_MTYPE_RNG; - len = sizeof(uint16_t); - buffer[0] = sz >> 8; - buffer[1] = sz; - - rv = eos_net_xchg(&type, buffer, &len); - if (rv || (len != sz)) rv = -1; - - if (!rv) memcpy(b, buffer, sz); - eos_net_free(buffer, 1); - - return rv; -} -- cgit v1.2.3