public void Add(CryptoProvider CryptoProvider) {
var ID = CryptoProvider.CryptoAlgorithmID;
var Slot = (int)ID;
var CryptoAlgorithm = CryptoProvider.CryptoAlgorithm;
if (CryptoAlgorithm == null) {
CryptoAlgorithm = new CryptoAlgorithm(CryptoProvider);
}
// If the array isn't big enough, then grow it
if (Slot >= Algorithms.Length) {
Array.Resize(ref Algorithms, Slot + 1);
}
Algorithms[(int)Slot] = CryptoAlgorithm;
SetDefault(ref _AlgorithmDigest, CryptoAlgorithm, ID, CryptoAlgorithmClass.Digest);
SetDefault(ref _AlgorithmMAC, CryptoAlgorithm, ID, CryptoAlgorithmClass.MAC);
SetDefault(ref _AlgorithmEncryption, CryptoAlgorithm, ID, CryptoAlgorithmClass.Encryption);
SetDefault(ref _AlgorithmSignature, CryptoAlgorithm, ID, CryptoAlgorithmClass.Signature);
SetDefault(ref _AlgorithmExchange, CryptoAlgorithm, ID, CryptoAlgorithmClass.Exchange);
}