Completed
Push — master ( 69d84a...30f5a4 )
by Philipp
11:35
created
src/GibberishAES/GibberishAES.php 1 patch
Doc Comments   +21 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      *                              (64 characters for example) for keeping high entropy.
86 86
      *                              The pass-phrase is converted internaly into
87 87
      *                              a binary key that is to be used for encryption.
88
-     * @return  mixed               base64 encrypted string, FALSE on failure.
88
+     * @return  string|false               base64 encrypted string, FALSE on failure.
89 89
      */
90 90
     public static function enc($string, $pass) {
91 91
 
@@ -283,6 +283,10 @@  discard block
 block discarded – undo
283 283
         return self::mbstring_func_overload() ? mb_strlen($str, '8bit') : strlen($str);
284 284
     }
285 285
 
286
+    /**
287
+     * @param integer $start
288
+     * @param integer $length
289
+     */
286 290
     protected static function substr($str, $start, $length = null) {
287 291
 
288 292
         if (self::mbstring_func_overload()) {
@@ -296,6 +300,9 @@  discard block
 block discarded – undo
296 300
         return isset($length) ? substr($str, $start, $length) : substr($str, $start);
297 301
     }
298 302
 
303
+    /**
304
+     * @param integer $length
305
+     */
299 306
     protected static function random_bytes($length) {
300 307
 
301 308
         $length = (int) $length;
@@ -440,6 +447,11 @@  discard block
 block discarded – undo
440 447
          */
441 448
     }
442 449
 
450
+    /**
451
+     * @param string $string
452
+     * @param string $key
453
+     * @param string $iv
454
+     */
443 455
     protected static function aes_cbc_encrypt($string, $key, $iv) {
444 456
 
445 457
         $key_size = self::$key_size;
@@ -472,6 +484,11 @@  discard block
 block discarded – undo
472 484
         return false;
473 485
     }
474 486
 
487
+    /**
488
+     * @param string $crypted
489
+     * @param string $key
490
+     * @param string $iv
491
+     */
475 492
     protected static function aes_cbc_decrypt($crypted, $key, $iv) {
476 493
 
477 494
         $key_size = self::$key_size;
@@ -512,6 +529,9 @@  discard block
 block discarded – undo
512 529
         return $string.str_repeat(chr($pad), $pad);
513 530
     }
514 531
 
532
+    /**
533
+     * @param string $string
534
+     */
515 535
     protected static function remove_pkcs7_pad($string) {
516 536
 
517 537
         // 128 bits: $block_length = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
Please login to merge, or discard this patch.