function AES($z)
    {
        $this->Nb = 4;
        $this->Nk = strlen($z) / 4;
        $this->Nr = $this->Nk + $this->Nb + 2;

        if ($this->Nk != 4 && $this->Nk != 6 && $this->Nk != 8) die("Key is " . ($this->Nk * 32) . " bits long. *not* 128, 192, or 256.");

        $this->Nr = $this->Nk + $this->Nb + 2;
        $this->w  = []; // Nb*(Nr+1) 32-bit words
        $this->s  = [[]];  // 2-D array of Nb colums and 4 rows

        $this->KeyExpansion($z); // places expanded key in w
    }
function AES($z)
    {
        $this->Nb = 4;
        $this->Nk = strlen($z) / 4;
        $this->Nr = $this->Nk + $this->Nb + 2;

        if ($this->Nk != 4 && $this->Nk != 6 && $this->Nk != 8) die("Key is " . ($this->Nk * 32) . " bits long. *not* 128, 192, or 256.");

        $this->Nr = $this->Nk + $this->Nb + 2;
        $this->w  = []; // Nb*(Nr+1) 32-bit words
        $this->s  = [[]];  // 2-D array of Nb colums and 4 rows

        $this->KeyExpansion($z); // places expanded key in w
    }
function AES ( $ z ) { $ this -> Nb = 4 ; $ this -> Nk = strlen ( $ z ) / 4 ; $ this -> Nr = $ this -> Nk + $ this -> Nb + 2 ; if ( $ this -> Nk != 4 && $ this -> Nk != 6 && $ this -> Nk != 8 ) die ( "Key is " . ( $ this -> Nk * 32 ) . " bits long. *not* 128, 192, or 256." ) ; $ this -> Nr = $ this -> Nk + $ this -> Nb + 2 ; $ this -> w = [ ] ; // Nb*(Nr+1) 32-bit words $ this -> s = [ [ ] ] ; // 2-D array of Nb colums and 4 rows $ this -> KeyExpansion ( $ z ) ; // places expanded key in w }
constructs an AES cipher using a specific key.
constructs an AES cipher using a specific key .