Skip to content

Commit

Permalink
Nits
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Jan 26, 2018
1 parent da67a28 commit bf6c1f6
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 63 deletions.
6 changes: 1 addition & 5 deletions src/Asymmetric/EncryptionPublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
namespace ParagonIE\Halite\Asymmetric;

use ParagonIE\ConstantTime\Binary;
use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidKey,
InvalidType
};
use ParagonIE\Halite\Alerts\InvalidKey;
use ParagonIE\Halite\HiddenString;

/**
Expand Down
7 changes: 2 additions & 5 deletions src/Asymmetric/EncryptionSecretKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
namespace ParagonIE\Halite\Asymmetric;

use ParagonIE\ConstantTime\Binary;
use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidKey,
InvalidType
};
use ParagonIE\Halite\Alerts\InvalidKey;
use ParagonIE\Halite\HiddenString;

/**
Expand Down Expand Up @@ -41,6 +37,7 @@ public function __construct(HiddenString $keyMaterial)
*
* @return EncryptionPublicKey
*
* @throws InvalidKey
* @throws \TypeError
*/
public function derivePublicKey()
Expand Down
4 changes: 0 additions & 4 deletions src/Asymmetric/PublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
declare(strict_types=1);
namespace ParagonIE\Halite\Asymmetric;

use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidType
};
use ParagonIE\Halite\HiddenString;
use ParagonIE\Halite\Key;

Expand Down
7 changes: 2 additions & 5 deletions src/Asymmetric/SecretKey.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php
namespace ParagonIE\Halite\Asymmetric;

use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidType
};
use ParagonIE\Halite\Alerts\CannotPerformOperation;
use ParagonIE\Halite\HiddenString;
use ParagonIE\Halite\Key;

Expand All @@ -29,7 +26,7 @@ public function __construct(HiddenString $keyMaterial)
parent::__construct($keyMaterial);
$this->isAsymmetricKey = true;
}

/**
* See the appropriate derived class.
* @throws CannotPerformOperation
Expand Down
6 changes: 1 addition & 5 deletions src/Asymmetric/SignaturePublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
namespace ParagonIE\Halite\Asymmetric;

use ParagonIE\ConstantTime\Binary;
use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidKey,
InvalidType
};
use ParagonIE\Halite\Alerts\InvalidKey;
use ParagonIE\Halite\HiddenString;

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Asymmetric/SignatureSecretKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
namespace ParagonIE\Halite\Asymmetric;

use ParagonIE\ConstantTime\Binary;
use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidKey,
InvalidType
};
use ParagonIE\Halite\Alerts\InvalidKey;
use ParagonIE\Halite\HiddenString;

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
declare(strict_types=1);
namespace ParagonIE\Halite;

use \ParagonIE\ConstantTime\{
use ParagonIE\ConstantTime\{
Base64UrlSafe,
Binary,
Hex
};
use \ParagonIE\Halite\Alerts\{
use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidDigestLength,
InvalidMessage,
InvalidSignature,
InvalidType
};
use \ParagonIE\Halite\Symmetric\{
use ParagonIE\Halite\Symmetric\{
Config as SymmetricConfig,
Crypto,
EncryptionKey
Expand Down
9 changes: 2 additions & 7 deletions src/EncryptionKeyPair.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
declare(strict_types=1);
namespace ParagonIE\Halite;

use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidKey,
InvalidType
};
use ParagonIE\Halite\Alerts\InvalidKey;
use ParagonIE\Halite\Asymmetric\{
EncryptionPublicKey,
EncryptionSecretKey
Expand Down Expand Up @@ -45,8 +41,6 @@ final class EncryptionKeyPair extends KeyPair
*
* @param array<int, Key> $keys
*
* @throws CannotPerformOperation
* @throws InvalidType
* @throws InvalidKey
* @throws \InvalidArgumentException
* @throws \TypeError
Expand Down Expand Up @@ -133,6 +127,7 @@ public function __construct(Key ...$keys)
* @param EncryptionSecretKey $secret
* @return void
*
* @throws InvalidKey
* @throws \TypeError
*/
protected function setupKeyPair(EncryptionSecretKey $secret): void
Expand Down
2 changes: 2 additions & 0 deletions src/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ public static function seal(
* @throws FileError
* @throws FileModified
* @throws InvalidDigestLength
* @throws InvalidKey
* @throws InvalidMessage
* @throws InvalidType
* @throws \TypeError
Expand Down Expand Up @@ -736,6 +737,7 @@ protected static function sealData(
* @throws FileError
* @throws FileModified
* @throws InvalidDigestLength
* @throws InvalidKey
* @throws InvalidMessage
* @throws InvalidType
* @throws \TypeError
Expand Down
4 changes: 1 addition & 3 deletions src/Key.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

use ParagonIE\Halite\Alerts\{
CannotCloneKey,
CannotPerformOperation,
CannotSerializeKey,
InvalidType
CannotSerializeKey
};

/**
Expand Down
6 changes: 0 additions & 6 deletions src/KeyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ public static function generateEncryptionKey(): EncryptionKey
*
* @return \ParagonIE\Halite\EncryptionKeyPair
*
* @throws CannotPerformOperation
* @throws InvalidKey
* @throws InvalidType
* @throws \TypeError
*/
public static function generateEncryptionKeyPair(): EncryptionKeyPair
Expand Down Expand Up @@ -236,7 +234,6 @@ public static function deriveEncryptionKey(
*
* @return EncryptionKeyPair
*
* @throws CannotPerformOperation
* @throws InvalidKey
* @throws InvalidSalt
* @throws InvalidType
Expand Down Expand Up @@ -506,9 +503,7 @@ public static function importSignatureSecretKey(HiddenString $keyData): Signatur
* @param HiddenString $keyData
* @return EncryptionKeyPair
*
* @throws CannotPerformOperation
* @throws InvalidKey
* @throws InvalidType
* @throws \TypeError
*/
public static function importEncryptionKeyPair(HiddenString $keyData): EncryptionKeyPair
Expand Down Expand Up @@ -692,7 +687,6 @@ public static function loadSignatureSecretKey(string $filePath): SignatureSecret
*
* @throws CannotPerformOperation
* @throws InvalidKey
* @throws InvalidType
* @throws \TypeError
* @codeCoverageIgnore
*/
Expand Down
7 changes: 2 additions & 5 deletions src/SignatureKeyPair.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
declare(strict_types=1);
namespace ParagonIE\Halite;

use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidKey,
InvalidType
};
use ParagonIE\Halite\Alerts\InvalidKey;
use ParagonIE\Halite\Asymmetric\{
SignaturePublicKey,
SignatureSecretKey
Expand Down Expand Up @@ -130,6 +126,7 @@ public function __construct(Key ...$keys)
* @param SignatureSecretKey $secret
* @return void
*
* @throws InvalidKey
* @throws \TypeError
*/
protected function setupKeyPair(SignatureSecretKey $secret): void
Expand Down
2 changes: 2 additions & 0 deletions src/Structure/MerkleTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public function setPersonalizationString(string $str = ''): self
*
* @return self
* @throws CannotPerformOperation
* @throws \TypeError
* @codeCoverageIgnore
*/
public function triggerRootCalculation(): self
Expand All @@ -173,6 +174,7 @@ public function triggerRootCalculation(): self
*
* @return string
* @throws CannotPerformOperation
* @throws \TypeError
*/
protected function calculateRoot(): string
{
Expand Down
1 change: 1 addition & 0 deletions src/Structure/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function getData(): string
*
* @return string
* @throws CannotPerformOperation
* @throws \TypeError
*/
public function getHash(
bool $raw = false,
Expand Down
1 change: 1 addition & 0 deletions src/Structure/TrimmedMerkleTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class TrimmedMerkleTree extends MerkleTree
*
* @return string
* @throws CannotPerformOperation
* @throws \TypeError
* @psalm-suppress EmptyArrayAccess Psalm is misreading array elements
*/
protected function calculateRoot(): string
Expand Down
6 changes: 1 addition & 5 deletions src/Symmetric/AuthenticationKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
namespace ParagonIE\Halite\Symmetric;

use ParagonIE\ConstantTime\Binary;
use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidKey,
InvalidType
};
use ParagonIE\Halite\Alerts\InvalidKey;
use ParagonIE\Halite\HiddenString;

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Symmetric/EncryptionKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
namespace ParagonIE\Halite\Symmetric;

use ParagonIE\ConstantTime\Binary;
use ParagonIE\Halite\Alerts\{
CannotPerformOperation,
InvalidKey,
InvalidType
};
use ParagonIE\Halite\Alerts\InvalidKey;
use ParagonIE\Halite\HiddenString;

/**
Expand Down

0 comments on commit bf6c1f6

Please sign in to comment.