CSPRNG.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
  2. #ifndef __gnu_javax_crypto_prng_CSPRNG__
  3. #define __gnu_javax_crypto_prng_CSPRNG__
  4. #pragma interface
  5. #include <gnu/java/security/prng/BasePRNG.h>
  6. #include <gcj/array.h>
  7. extern "Java"
  8. {
  9. namespace gnu
  10. {
  11. namespace java
  12. {
  13. namespace security
  14. {
  15. namespace hash
  16. {
  17. class IMessageDigest;
  18. }
  19. namespace prng
  20. {
  21. class IRandom;
  22. }
  23. }
  24. }
  25. namespace javax
  26. {
  27. namespace crypto
  28. {
  29. namespace cipher
  30. {
  31. class IBlockCipher;
  32. }
  33. namespace prng
  34. {
  35. class CSPRNG;
  36. class CSPRNG$Poller;
  37. class CSPRNG$Spinner;
  38. }
  39. }
  40. }
  41. }
  42. }
  43. class gnu::javax::crypto::prng::CSPRNG : public ::gnu::java::security::prng::BasePRNG
  44. {
  45. public:
  46. CSPRNG();
  47. static ::gnu::java::security::prng::IRandom * getSystemInstance();
  48. private:
  49. static ::java::lang::String * getProperty(::java::lang::String *);
  50. static ::java::util::List * parseString(::java::lang::String *);
  51. static ::java::util::List * parseURL(::java::lang::String *);
  52. public:
  53. virtual ::java::lang::Object * clone();
  54. virtual void setup(::java::util::Map *);
  55. virtual void fillBlock();
  56. virtual void addRandomBytes(JArray< jbyte > *, jint, jint);
  57. virtual void addRandomByte(jbyte);
  58. public: // actually package-private
  59. virtual void addQuality(jdouble);
  60. virtual jdouble getQuality();
  61. private:
  62. void mixRandomPool(JArray< jbyte > *);
  63. void mixRandomPool();
  64. void generateX917(JArray< jbyte > *);
  65. void fastPoll();
  66. void slowPoll();
  67. public: // actually protected
  68. virtual void finalize();
  69. private:
  70. static ::java::util::logging::Logger * log;
  71. public:
  72. static ::java::lang::String * FILE_SOURCES;
  73. static ::java::lang::String * URL_SOURCES;
  74. static ::java::lang::String * PROGRAM_SOURCES;
  75. static ::java::lang::String * OTHER_SOURCES;
  76. static ::java::lang::String * BLOCKING;
  77. private:
  78. static ::java::lang::String * FILES;
  79. static ::java::lang::String * URLS;
  80. static ::java::lang::String * PROGS;
  81. static ::java::lang::String * OTHER;
  82. static ::java::lang::String * BLOCK;
  83. static const jint POOL_SIZE = 256;
  84. static const jint ALLOC_SIZE = 260;
  85. static const jint OUTPUT_SIZE = 128;
  86. static const jint X917_POOL_SIZE = 16;
  87. static ::java::lang::String * HASH_FUNCTION;
  88. static ::java::lang::String * CIPHER;
  89. static const jint MIX_COUNT = 10;
  90. static const jint X917_LIFETIME = 8192;
  91. static const jint SPINNER_COUNT = 8;
  92. static JArray< ::gnu::javax::crypto::prng::CSPRNG$Spinner * > * SPINNERS;
  93. static JArray< ::java::lang::Thread * > * SPINNER_THREADS;
  94. ::gnu::java::security::hash::IMessageDigest * __attribute__((aligned(__alignof__( ::gnu::java::security::prng::BasePRNG)))) hash;
  95. ::gnu::javax::crypto::cipher::IBlockCipher * cipher;
  96. jint mixCount;
  97. JArray< jbyte > * pool;
  98. jdouble quality;
  99. jint index;
  100. JArray< jbyte > * x917pool;
  101. jint x917count;
  102. jboolean x917init;
  103. ::java::util::List * files;
  104. ::java::util::List * urls;
  105. ::java::util::List * progs;
  106. ::java::util::List * other;
  107. jboolean blocking;
  108. ::gnu::javax::crypto::prng::CSPRNG$Poller * poller;
  109. ::java::lang::Thread * pollerThread;
  110. public:
  111. static ::java::lang::Class class$;
  112. };
  113. #endif // __gnu_javax_crypto_prng_CSPRNG__