Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

57 wiersze
1.7 KiB

  1. /*
  2. * Copyright (C) 2021 - 2022, Stephan Mueller <smueller@chronox.de>
  3. *
  4. * License: see LICENSE file in root directory
  5. *
  6. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  7. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  8. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
  9. * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
  10. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  11. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
  12. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  13. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  14. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  16. * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
  17. * DAMAGE.
  18. */
  19. #ifndef JITTERENTROPY_HEALTH_H
  20. #define JITTERENTROPY_HEALTH_H
  21. #include "jitterentropy.h"
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif
  26. void jent_health_cb_block_switch(void);
  27. int jent_set_fips_failure_callback_internal(jent_fips_failure_cb cb);
  28. static inline uint64_t jent_delta(uint64_t prev, uint64_t next)
  29. {
  30. return (next - prev);
  31. }
  32. #ifdef JENT_HEALTH_LAG_PREDICTOR
  33. void jent_lag_init(struct rand_data *ec, unsigned int osr);
  34. #else /* JENT_HEALTH_LAG_PREDICTOR */
  35. static inline void jent_lag_init(struct rand_data *ec, unsigned int osr)
  36. {
  37. (void)ec;
  38. (void)osr;
  39. }
  40. #endif /* JENT_HEALTH_LAG_PREDICTOR */
  41. void jent_apt_init(struct rand_data *ec, unsigned int osr);
  42. unsigned int jent_stuck(struct rand_data *ec, uint64_t current_delta);
  43. unsigned int jent_health_failure(struct rand_data *ec);
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif /* JITTERENTROPY_HEALTH_H */