diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 9c0de2580b..7c308855ed 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -5379,9 +5379,10 @@ void RSAKey::createKeyPair (RSAKey& publicKey, RSAKey& privateKey, const int numBits, const int* randomSeeds, const int numRandomSeeds) { jassert (numBits > 16); // not much point using less than this.. + jassert (numRandomSeeds == 0 || numRandomSeeds >= 2); // you need to provide plenty of seeds here! - BigInteger p (Primes::createProbablePrime (numBits / 2, 30, randomSeeds, numRandomSeeds)); - BigInteger q (Primes::createProbablePrime (numBits - numBits / 2, 30, randomSeeds, numRandomSeeds)); + BigInteger p (Primes::createProbablePrime (numBits / 2, 30, randomSeeds, numRandomSeeds / 2)); + BigInteger q (Primes::createProbablePrime (numBits - numBits / 2, 30, randomSeeds == 0 ? 0 : (randomSeeds + numRandomSeeds / 2), numRandomSeeds - numRandomSeeds / 2)); const BigInteger n (p * q); const BigInteger m (--p * --q); diff --git a/juce_amalgamated.h b/juce_amalgamated.h index b3add5bd38..97bfa6cf2c 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -15031,7 +15031,8 @@ public: The randomSeeds parameter lets you optionally pass it a set of values with which to seed the random number generation, improving the security of the - keys generated. + keys generated. If you supply these, make sure you provide more than 2 values, + and the more your provide, the better the security. */ static void createKeyPair (RSAKey& publicKey, RSAKey& privateKey, @@ -36886,38 +36887,53 @@ public: /** This structure holds a set of properties describing the current audio setup. - @see AudioDeviceManager::setAudioDeviceSetup() + An AudioDeviceManager uses this class to save/load its current settings, and to + specify your preferred options when opening a device. + + @see AudioDeviceManager::setAudioDeviceSetup(), AudioDeviceManager::initialise() */ struct JUCE_API AudioDeviceSetup { + /** Creates an AudioDeviceSetup object. + + The default constructor sets all the member variables to indicate default values. + You can then fill-in any values you want to before passing the object to + AudioDeviceManager::initialise(). + */ AudioDeviceSetup(); + bool operator== (const AudioDeviceSetup& other) const; /** The name of the audio device used for output. The name has to be one of the ones listed by the AudioDeviceManager's currently selected device type. This may be the same as the input device. + An empty string indicates the default device. */ String outputDeviceName; /** The name of the audio device used for input. This may be the same as the output device. + An empty string indicates the default device. */ String inputDeviceName; /** The current sample rate. This rate is used for both the input and output devices. + A value of 0 indicates the default rate. */ double sampleRate; /** The buffer size, in samples. This buffer size is used for both the input and output devices. + A value of 0 indicates the default buffer size. */ int bufferSize; /** The set of active input channels. The bits that are set in this array indicate the channels of the input device that are active. + If useDefaultInputChannels is true, this value is ignored. */ BigInteger inputChannels; @@ -36930,6 +36946,7 @@ public: /** The set of active output channels. The bits that are set in this array indicate the channels of the input device that are active. + If useDefaultOutputChannels is true, this value is ignored. */ BigInteger outputChannels; diff --git a/src/audio/devices/juce_AudioDeviceManager.h b/src/audio/devices/juce_AudioDeviceManager.h index 6efbdadd43..3e9441fbc5 100644 --- a/src/audio/devices/juce_AudioDeviceManager.h +++ b/src/audio/devices/juce_AudioDeviceManager.h @@ -91,38 +91,53 @@ public: /** This structure holds a set of properties describing the current audio setup. - @see AudioDeviceManager::setAudioDeviceSetup() + An AudioDeviceManager uses this class to save/load its current settings, and to + specify your preferred options when opening a device. + + @see AudioDeviceManager::setAudioDeviceSetup(), AudioDeviceManager::initialise() */ struct JUCE_API AudioDeviceSetup { + /** Creates an AudioDeviceSetup object. + + The default constructor sets all the member variables to indicate default values. + You can then fill-in any values you want to before passing the object to + AudioDeviceManager::initialise(). + */ AudioDeviceSetup(); + bool operator== (const AudioDeviceSetup& other) const; /** The name of the audio device used for output. The name has to be one of the ones listed by the AudioDeviceManager's currently selected device type. This may be the same as the input device. + An empty string indicates the default device. */ String outputDeviceName; /** The name of the audio device used for input. This may be the same as the output device. + An empty string indicates the default device. */ String inputDeviceName; /** The current sample rate. This rate is used for both the input and output devices. + A value of 0 indicates the default rate. */ double sampleRate; /** The buffer size, in samples. This buffer size is used for both the input and output devices. + A value of 0 indicates the default buffer size. */ int bufferSize; /** The set of active input channels. The bits that are set in this array indicate the channels of the input device that are active. + If useDefaultInputChannels is true, this value is ignored. */ BigInteger inputChannels; @@ -135,6 +150,7 @@ public: /** The set of active output channels. The bits that are set in this array indicate the channels of the input device that are active. + If useDefaultOutputChannels is true, this value is ignored. */ BigInteger outputChannels; diff --git a/src/cryptography/juce_RSAKey.cpp b/src/cryptography/juce_RSAKey.cpp index 22beb89ab3..8350fdcccb 100644 --- a/src/cryptography/juce_RSAKey.cpp +++ b/src/cryptography/juce_RSAKey.cpp @@ -120,9 +120,10 @@ void RSAKey::createKeyPair (RSAKey& publicKey, RSAKey& privateKey, const int numBits, const int* randomSeeds, const int numRandomSeeds) { jassert (numBits > 16); // not much point using less than this.. + jassert (numRandomSeeds == 0 || numRandomSeeds >= 2); // you need to provide plenty of seeds here! - BigInteger p (Primes::createProbablePrime (numBits / 2, 30, randomSeeds, numRandomSeeds)); - BigInteger q (Primes::createProbablePrime (numBits - numBits / 2, 30, randomSeeds, numRandomSeeds)); + BigInteger p (Primes::createProbablePrime (numBits / 2, 30, randomSeeds, numRandomSeeds / 2)); + BigInteger q (Primes::createProbablePrime (numBits - numBits / 2, 30, randomSeeds == 0 ? 0 : (randomSeeds + numRandomSeeds / 2), numRandomSeeds - numRandomSeeds / 2)); const BigInteger n (p * q); const BigInteger m (--p * --q); diff --git a/src/cryptography/juce_RSAKey.h b/src/cryptography/juce_RSAKey.h index 3539dce6bd..0c18d2d45e 100644 --- a/src/cryptography/juce_RSAKey.h +++ b/src/cryptography/juce_RSAKey.h @@ -92,7 +92,8 @@ public: The randomSeeds parameter lets you optionally pass it a set of values with which to seed the random number generation, improving the security of the - keys generated. + keys generated. If you supply these, make sure you provide more than 2 values, + and the more your provide, the better the security. */ static void createKeyPair (RSAKey& publicKey, RSAKey& privateKey,