@@ -851,22 +851,6 @@ Init_ossl_cipher(void)
851851 *
852852 * cipher = OpenSSL::Cipher.new('AES-128-CBC')
853853 *
854- * For each algorithm supported, there is a class defined under the
855- * Cipher class that goes by the name of the cipher, e.g. to obtain an
856- * instance of AES, you could also use
857- *
858- * # these are equivalent
859- * cipher = OpenSSL::Cipher::AES.new(128, :CBC)
860- * cipher = OpenSSL::Cipher::AES.new(128, 'CBC')
861- * cipher = OpenSSL::Cipher::AES.new('128-CBC')
862- *
863- * Finally, due to its wide-spread use, there are also extra classes
864- * defined for the different key sizes of AES
865- *
866- * cipher = OpenSSL::Cipher::AES128.new(:CBC)
867- * cipher = OpenSSL::Cipher::AES192.new(:CBC)
868- * cipher = OpenSSL::Cipher::AES256.new(:CBC)
869- *
870854 * === Choosing either encryption or decryption mode
871855 *
872856 * Encryption and decryption are often very similar operations for
@@ -895,7 +879,7 @@ Init_ossl_cipher(void)
895879 * without processing the password further. A simple and secure way to
896880 * create a key for a particular Cipher is
897881 *
898- * cipher = OpenSSL::Cipher::AES256 .new(: CFB)
882+ * cipher = OpenSSL::Cipher.new('AES-256- CFB' )
899883 * cipher.encrypt
900884 * key = cipher.random_key # also sets the generated key on the Cipher
901885 *
@@ -963,14 +947,14 @@ Init_ossl_cipher(void)
963947 *
964948 * data = "Very, very confidential data"
965949 *
966- * cipher = OpenSSL::Cipher::AES .new(128, : CBC)
950+ * cipher = OpenSSL::Cipher.new('AES- 128- CBC' )
967951 * cipher.encrypt
968952 * key = cipher.random_key
969953 * iv = cipher.random_iv
970954 *
971955 * encrypted = cipher.update(data) + cipher.final
972956 * ...
973- * decipher = OpenSSL::Cipher::AES .new(128, : CBC)
957+ * decipher = OpenSSL::Cipher.new('AES- 128- CBC' )
974958 * decipher.decrypt
975959 * decipher.key = key
976960 * decipher.iv = iv
@@ -1006,7 +990,7 @@ Init_ossl_cipher(void)
1006990 * not to reuse the _key_ and _nonce_ pair. Reusing an nonce ruins the
1007991 * security guarantees of GCM mode.
1008992 *
1009- * cipher = OpenSSL::Cipher::AES .new(128, : GCM).encrypt
993+ * cipher = OpenSSL::Cipher.new('AES- 128- GCM' ).encrypt
1010994 * cipher.key = key
1011995 * cipher.iv = nonce
1012996 * cipher.auth_data = auth_data
@@ -1022,7 +1006,7 @@ Init_ossl_cipher(void)
10221006 * ciphertext with a probability of 1/256.
10231007 *
10241008 * raise "tag is truncated!" unless tag.bytesize == 16
1025- * decipher = OpenSSL::Cipher::AES .new(128, : GCM).decrypt
1009+ * decipher = OpenSSL::Cipher.new('AES- 128- GCM' ).decrypt
10261010 * decipher.key = key
10271011 * decipher.iv = nonce
10281012 * decipher.auth_tag = tag
0 commit comments