| 1 | /* librist. Copyright © 2019 SipRadius LLC. All right reserved. |
| 2 | * Author: Kuldeep Singh Dhaka <[email protected]> |
| 3 | * Author: Sergio Ammirata, Ph.D. <[email protected]> |
| 4 | * |
| 5 | * SPDX-License-Identifier: BSD-2-Clause |
| 6 | */ |
| 7 | |
| 8 | #ifndef RIST_CRYPTO_PRIVATE_H |
| 9 | #define RIST_CRYPTO_PRIVATE_H |
| 10 | |
| 11 | #include "common/attributes.h" |
| 12 | #include <stdint.h> |
| 13 | |
| 14 | RIST_PRIV uint64_t rist_siphash(uint64_t birthtime, uint32_t seq, const char *phrase); |
| 15 | |
| 16 | /* prand_u32: wall-clock fallback on CSPRNG failure. Non-security only (SSRC, flow-id, peer-id). */ |
| 17 | RIST_PRIV uint32_t prand_u32(void); |
| 18 | |
| 19 | /* Fail-closed CSPRNG. Returns 0 on success with *out populated, non-zero error otherwise. */ |
| 20 | RIST_PRIV int _librist_crypto_random_u32(uint32_t *out); |
| 21 | |
| 22 | #endif |