Commit a074e2f1 authored by Vladimír Čunát's avatar Vladimír Čunát

remove kr_rand_bytes_nonstatic()

It seems simpler, now that we have kr_rnd_buffered().
parent 98cb9592
......@@ -293,7 +293,7 @@ int kr_pkt_recycle(knot_pkt_t *);
int kr_pkt_clear_payload(knot_pkt_t *);
uint16_t kr_pkt_qclass(const knot_pkt_t *);
uint16_t kr_pkt_qtype(const knot_pkt_t *);
uint64_t kr_rand_bytes_nonstatic(int);
void kr_rnd_buffered(void *, unsigned int);
uint32_t kr_rrsig_sig_inception(const knot_rdata_t *);
uint32_t kr_rrsig_sig_expiration(const knot_rdata_t *);
uint16_t kr_rrsig_type_covered(const knot_rdata_t *);
......
......@@ -147,7 +147,7 @@ EOF
kr_pkt_clear_payload
kr_pkt_qclass
kr_pkt_qtype
kr_rand_bytes_nonstatic
kr_rnd_buffered
kr_rrsig_sig_inception
kr_rrsig_sig_expiration
kr_rrsig_type_covered
......
......@@ -549,7 +549,7 @@ ffi.metatype( knot_pkt_t, {
error(string.format('failed to allocate a packet of size %d', size))
end
if wire == nil then
pkt:id(tonumber(C.kr_rand_bytes_nonstatic(2)))
C.kr_rnd_buffered(pkt.wire, 2) -- randomize the query ID
else
assert(size <= #wire)
ffi.copy(pkt.wire, wire, size)
......
......@@ -1049,8 +1049,4 @@ uint16_t kr_rrsig_type_covered(const knot_rdata_t *rdata)
{
return knot_rrsig_type_covered(rdata);
}
uint64_t kr_rand_bytes_nonstatic(int size)
{
return kr_rand_bytes(size);
}
......@@ -209,8 +209,6 @@ static inline uint64_t kr_rand_bytes(int size)
}
return result;
}
/** non-static variant of kr_rand_bytes() */
KR_EXPORT uint64_t kr_rand_bytes_nonstatic(int size);
/** Throw a pseudo-random coin, succeeding approximately with probability nomin/denomin.
* - low precision, only one byte of randomness
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment