Esempio n. 1
0
        /// <summary>Generates and returns a mask from the specified random seed of the specified length.</summary>
        /// <returns>A randomly generated mask whose length is equal to the <paramref name="cbReturn" /> parameter.</returns>
        /// <param name="rgbSeed">The random seed to use for computing the mask. </param>
        /// <param name="cbReturn">The length of the generated mask in bytes. </param>
        public override byte[] GenerateMask(byte[] rgbSeed, int cbReturn)
        {
            HashAlgorithm hash = HashAlgorithm.Create(this.hashName);

            return(PKCS1.MGF1(hash, rgbSeed, cbReturn));
        }
Esempio n. 2
0
        // This method is not compatible with the one provided by MS in
        // framework 1.0 and 1.1 but IS compliant with PKCS#1 v.2.1 and
        // work for implementing OAEP
        public override byte[] GenerateMask(byte[] mgfSeed, int maskLen)
        {
            HashAlgorithm hash = HashAlgorithm.Create(hashName);

            return(PKCS1.MGF1(hash, mgfSeed, maskLen));
        }