@@ -9,8 +9,7 @@ discard block |
||
| 9 | 9 | * |
| 10 | 10 | * This represents a Field Element |
| 11 | 11 | */ |
| 12 | -class ParagonIE_Sodium_Core32_Curve25519_Fe implements ArrayAccess |
|
| 13 | -{ |
|
| 12 | +class ParagonIE_Sodium_Core32_Curve25519_Fe implements ArrayAccess { |
|
| 14 | 13 | /** |
| 15 | 14 | * @var array<int, ParagonIE_Sodium_Core32_Int32> |
| 16 | 15 | */ |
@@ -30,8 +29,7 @@ discard block |
||
| 30 | 29 | * @throws SodiumException |
| 31 | 30 | * @throws TypeError |
| 32 | 31 | */ |
| 33 | - public static function fromArray($array, $save_indexes = null) |
|
| 34 | - { |
|
| 32 | + public static function fromArray($array, $save_indexes = null) { |
|
| 35 | 33 | $count = count($array); |
| 36 | 34 | if ($save_indexes) { |
| 37 | 35 | $keys = array_keys($array); |
@@ -64,8 +62,7 @@ discard block |
||
| 64 | 62 | * @throws SodiumException |
| 65 | 63 | * @throws TypeError |
| 66 | 64 | */ |
| 67 | - public static function fromIntArray($array, $save_indexes = null) |
|
| 68 | - { |
|
| 65 | + public static function fromIntArray($array, $save_indexes = null) { |
|
| 69 | 66 | $count = count($array); |
| 70 | 67 | if ($save_indexes) { |
| 71 | 68 | $keys = array_keys($array); |
@@ -105,8 +102,7 @@ discard block |
||
| 105 | 102 | * @throws TypeError |
| 106 | 103 | */ |
| 107 | 104 | #[ReturnTypeWillChange] |
| 108 | - public function offsetSet($offset, $value) |
|
| 109 | - { |
|
| 105 | + public function offsetSet($offset, $value) { |
|
| 110 | 106 | if (!($value instanceof ParagonIE_Sodium_Core32_Int32)) { |
| 111 | 107 | throw new InvalidArgumentException('Expected an instance of ParagonIE_Sodium_Core32_Int32'); |
| 112 | 108 | } |
@@ -126,8 +122,7 @@ discard block |
||
| 126 | 122 | * @psalm-suppress MixedArrayOffset |
| 127 | 123 | */ |
| 128 | 124 | #[ReturnTypeWillChange] |
| 129 | - public function offsetExists($offset) |
|
| 130 | - { |
|
| 125 | + public function offsetExists($offset) { |
|
| 131 | 126 | return isset($this->container[$offset]); |
| 132 | 127 | } |
| 133 | 128 | |
@@ -139,8 +134,7 @@ discard block |
||
| 139 | 134 | * @psalm-suppress MixedArrayOffset |
| 140 | 135 | */ |
| 141 | 136 | #[ReturnTypeWillChange] |
| 142 | - public function offsetUnset($offset) |
|
| 143 | - { |
|
| 137 | + public function offsetUnset($offset) { |
|
| 144 | 138 | unset($this->container[$offset]); |
| 145 | 139 | } |
| 146 | 140 | |
@@ -152,8 +146,7 @@ discard block |
||
| 152 | 146 | * @psalm-suppress MixedArrayOffset |
| 153 | 147 | */ |
| 154 | 148 | #[ReturnTypeWillChange] |
| 155 | - public function offsetGet($offset) |
|
| 156 | - { |
|
| 149 | + public function offsetGet($offset) { |
|
| 157 | 150 | if (!isset($this->container[$offset])) { |
| 158 | 151 | $this->container[(int) $offset] = new ParagonIE_Sodium_Core32_Int32(); |
| 159 | 152 | } |
@@ -167,8 +160,7 @@ discard block |
||
| 167 | 160 | * |
| 168 | 161 | * @return array |
| 169 | 162 | */ |
| 170 | - public function __debugInfo() |
|
| 171 | - { |
|
| 163 | + public function __debugInfo() { |
|
| 172 | 164 | if (empty($this->container)) { |
| 173 | 165 | return array(); |
| 174 | 166 | } |
@@ -9,8 +9,7 @@ |
||
| 9 | 9 | * |
| 10 | 10 | * This just contains the constants in the ref10/base.h file |
| 11 | 11 | */ |
| 12 | -class ParagonIE_Sodium_Core32_Curve25519_H extends ParagonIE_Sodium_Core32_Util |
|
| 13 | -{ |
|
| 12 | +class ParagonIE_Sodium_Core32_Curve25519_H extends ParagonIE_Sodium_Core32_Util { |
|
| 14 | 13 | /** |
| 15 | 14 | * See: libsodium's crypto_core/curve25519/ref10/base.h |
| 16 | 15 | * |
@@ -7,8 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * Class ParagonIE_Sodium_Core32_Curve25519_Ge_P3 |
| 9 | 9 | */ |
| 10 | -class ParagonIE_Sodium_Core32_Curve25519_Ge_P3 |
|
| 11 | -{ |
|
| 10 | +class ParagonIE_Sodium_Core32_Curve25519_Ge_P3 { |
|
| 12 | 11 | /** |
| 13 | 12 | * @var ParagonIE_Sodium_Core32_Curve25519_Fe |
| 14 | 13 | */ |
@@ -7,8 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * Class ParagonIE_Sodium_Core32_Curve25519_Ge_P2 |
| 9 | 9 | */ |
| 10 | -class ParagonIE_Sodium_Core32_Curve25519_Ge_P2 |
|
| 11 | -{ |
|
| 10 | +class ParagonIE_Sodium_Core32_Curve25519_Ge_P2 { |
|
| 12 | 11 | /** |
| 13 | 12 | * @var ParagonIE_Sodium_Core32_Curve25519_Fe |
| 14 | 13 | */ |
@@ -6,8 +6,7 @@ |
||
| 6 | 6 | /** |
| 7 | 7 | * Class ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 |
| 8 | 8 | */ |
| 9 | -class ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 |
|
| 10 | -{ |
|
| 9 | +class ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 { |
|
| 11 | 10 | /** |
| 12 | 11 | * @var ParagonIE_Sodium_Core32_Curve25519_Fe |
| 13 | 12 | */ |
@@ -7,8 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * Class ParagonIE_Sodium_Core32_Curve25519_Ge_Cached |
| 9 | 9 | */ |
| 10 | -class ParagonIE_Sodium_Core32_Curve25519_Ge_Cached |
|
| 11 | -{ |
|
| 10 | +class ParagonIE_Sodium_Core32_Curve25519_Ge_Cached { |
|
| 12 | 11 | /** |
| 13 | 12 | * @var ParagonIE_Sodium_Core32_Curve25519_Fe |
| 14 | 13 | */ |
@@ -7,8 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * Class ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp |
| 9 | 9 | */ |
| 10 | -class ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp |
|
| 11 | -{ |
|
| 10 | +class ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp { |
|
| 12 | 11 | /** |
| 13 | 12 | * @var ParagonIE_Sodium_Core32_Curve25519_Fe |
| 14 | 13 | */ |
@@ -7,8 +7,7 @@ discard block |
||
| 7 | 7 | /** |
| 8 | 8 | * Class ParagonIE_Sodium_Core32_ChaCha20_Ctx |
| 9 | 9 | */ |
| 10 | -class ParagonIE_Sodium_Core32_ChaCha20_Ctx extends ParagonIE_Sodium_Core32_Util implements ArrayAccess |
|
| 11 | -{ |
|
| 10 | +class ParagonIE_Sodium_Core32_ChaCha20_Ctx extends ParagonIE_Sodium_Core32_Util implements ArrayAccess { |
|
| 12 | 11 | /** |
| 13 | 12 | * @var SplFixedArray internally, <int, ParagonIE_Sodium_Core32_Int32> |
| 14 | 13 | */ |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | * @throws SodiumException |
| 28 | 27 | * @throws TypeError |
| 29 | 28 | */ |
| 30 | - public function __construct($key = '', $iv = '', $counter = '') |
|
| 31 | - { |
|
| 29 | + public function __construct($key = '', $iv = '', $counter = '') { |
|
| 32 | 30 | if (self::strlen($key) !== 32) { |
| 33 | 31 | throw new InvalidArgumentException('ChaCha20 expects a 256-bit key.'); |
| 34 | 32 | } |
@@ -71,8 +69,7 @@ discard block |
||
| 71 | 69 | * @return void |
| 72 | 70 | */ |
| 73 | 71 | #[ReturnTypeWillChange] |
| 74 | - public function offsetSet($offset, $value) |
|
| 75 | - { |
|
| 72 | + public function offsetSet($offset, $value) { |
|
| 76 | 73 | if (!is_int($offset)) { |
| 77 | 74 | throw new InvalidArgumentException('Expected an integer'); |
| 78 | 75 | } |
@@ -95,8 +92,7 @@ discard block |
||
| 95 | 92 | * @psalm-suppress MixedArrayOffset |
| 96 | 93 | */ |
| 97 | 94 | #[ReturnTypeWillChange] |
| 98 | - public function offsetExists($offset) |
|
| 99 | - { |
|
| 95 | + public function offsetExists($offset) { |
|
| 100 | 96 | return isset($this->container[$offset]); |
| 101 | 97 | } |
| 102 | 98 | |
@@ -108,8 +104,7 @@ discard block |
||
| 108 | 104 | * @psalm-suppress MixedArrayOffset |
| 109 | 105 | */ |
| 110 | 106 | #[ReturnTypeWillChange] |
| 111 | - public function offsetUnset($offset) |
|
| 112 | - { |
|
| 107 | + public function offsetUnset($offset) { |
|
| 113 | 108 | unset($this->container[$offset]); |
| 114 | 109 | } |
| 115 | 110 | |
@@ -121,8 +116,7 @@ discard block |
||
| 121 | 116 | * @psalm-suppress MixedArrayOffset |
| 122 | 117 | */ |
| 123 | 118 | #[ReturnTypeWillChange] |
| 124 | - public function offsetGet($offset) |
|
| 125 | - { |
|
| 119 | + public function offsetGet($offset) { |
|
| 126 | 120 | return isset($this->container[$offset]) |
| 127 | 121 | ? $this->container[$offset] |
| 128 | 122 | : null; |
@@ -7,8 +7,7 @@ discard block |
||
| 7 | 7 | /** |
| 8 | 8 | * Class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx |
| 9 | 9 | */ |
| 10 | -class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core32_ChaCha20_Ctx |
|
| 11 | -{ |
|
| 10 | +class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core32_ChaCha20_Ctx { |
|
| 12 | 11 | /** |
| 13 | 12 | * ParagonIE_Sodium_Core_ChaCha20_IetfCtx constructor. |
| 14 | 13 | * |
@@ -22,8 +21,7 @@ discard block |
||
| 22 | 21 | * @throws SodiumException |
| 23 | 22 | * @throws TypeError |
| 24 | 23 | */ |
| 25 | - public function __construct($key = '', $iv = '', $counter = '') |
|
| 26 | - { |
|
| 24 | + public function __construct($key = '', $iv = '', $counter = '') { |
|
| 27 | 25 | if (self::strlen($iv) !== 12) { |
| 28 | 26 | throw new InvalidArgumentException('ChaCha20 expects a 96-bit nonce in IETF mode.'); |
| 29 | 27 | } |