From 45f1f28472b361b6ab7b35575cf70a7380cd5f10 Mon Sep 17 00:00:00 2001 From: Dusan Malusev Date: Tue, 27 Feb 2024 20:44:17 +0100 Subject: [PATCH] Change namespace Signed-off-by: Dusan Malusev --- README.md | 10 +- README.old.md | 18 +-- benchmarks/Base64Bench.php | 4 +- benchmarks/DecryptionBench.php | 6 +- benchmarks/EncryptionBench.php | 16 +-- benchmarks/KeyLoader.php | 4 +- composer.json | 10 +- composer.lock | 134 +++++++++--------- config/crypto.php | 8 +- src/Console/GenerateCryptoKeysCommand.php | 10 +- src/Contracts/Hashing.php | 2 +- src/Contracts/KeyGeneration.php | 2 +- src/Contracts/PublicKeySigning.php | 2 +- src/Contracts/Signing.php | 2 +- src/Encoder/Encoder.php | 2 +- src/Encoder/IgbinaryEncoder.php | 2 +- src/Encoder/JsonEncoder.php | 2 +- src/Encoder/MessagePackEncoder.php | 2 +- src/Encoder/PhpEncoder.php | 2 +- src/Encryption/AesGcm256Encryptor.php | 12 +- src/Encryption/Crypto.php | 10 +- src/Encryption/Encryption.php | 2 +- src/Encryption/XChaCha20Poly1305Encryptor.php | 10 +- src/Exceptions/KeyPathNotFound.php | 2 +- src/Facades/Hashing.php | 6 +- src/Facades/Sign.php | 4 +- src/Hashing/Blake2b.php | 10 +- src/Hashing/HashingManager.php | 6 +- src/Hashing/Sha256.php | 8 +- src/Hashing/Sha512.php | 8 +- src/Hashing/Traits/Blake2b.php | 4 +- src/Hashing/Traits/Hash.php | 2 +- src/Hashing/Traits/Sha256.php | 6 +- src/Hashing/Traits/Sha512.php | 6 +- src/Keys/AppKey.php | 8 +- src/Keys/Blake2bHashingKey.php | 4 +- src/Keys/EdDSASignerKey.php | 2 +- src/Keys/EnvKeySaver.php | 4 +- src/Keys/Generator.php | 2 +- src/Keys/HmacKey.php | 2 +- src/Keys/LaravelKeyParser.php | 4 +- src/Keys/Loader.php | 2 +- src/ServiceProvider.php | 54 +++---- src/Signing/EdDSA/EdDSA.php | 10 +- src/Signing/Hmac/Blake2b.php | 8 +- src/Signing/Hmac/Sha256.php | 10 +- src/Signing/Hmac/Sha512.php | 8 +- src/Signing/SigningManager.php | 4 +- src/Signing/Traits/Blake2b.php | 6 +- src/Signing/Traits/EdDSA.php | 6 +- src/Signing/Traits/Hmac256.php | 4 +- src/Signing/Traits/Hmac512.php | 4 +- src/Signing/Traits/Signing.php | 6 +- src/Support/Base64.php | 2 +- src/Support/Random.php | 2 +- src/Support/Random82.php | 2 +- src/Traits/ConstantTimeCompare.php | 2 +- testbench.yaml | 2 +- .../Encryption/AesGcm256EncryptorTest.php | 2 +- .../XChaCha20Poly1305EncryptorTest.php | 2 +- tests/Feature/ServiceProviderLoadingTest.php | 6 +- tests/InMemoryAppKeyLoader.php | 4 +- tests/Pest.php | 6 +- tests/TestCase.php | 4 +- tests/Unit/Encoders/IgbinaryEncoderTest.php | 2 +- tests/Unit/Encoders/JsonEncoderTest.php | 2 +- tests/Unit/Encoders/PhpEncoderTest.php | 2 +- tests/Unit/Encryption/CryptoTraitTest.php | 4 +- tests/Unit/Hashing/Blake2bTest.php | 2 +- tests/Unit/Hashing/Sha256Test.php | 2 +- tests/Unit/Hashing/Sha512Test.php | 2 +- tests/Unit/Support/Base64Test.php | 2 +- workbench/config/app.php | 4 +- 73 files changed, 269 insertions(+), 269 deletions(-) diff --git a/README.md b/README.md index def69eb..28860c2 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,13 @@ As long as you use default laravel encryption, you don't need to change anything ### Installing ```shell script -composer require brossquad/laravel-crypto +composer require codelieutenant/laravel-crypto ``` ### Publishing config file ```shell script -php artisan vendor:publish --provider="BrosSquad\LaravelCrypto\ServiceProvider" +php artisan vendor:publish --provider="CodeLieutenant\LaravelCrypto\ServiceProvider" ``` ### Replacing Laravel's EncryptionServiceProvider with LaravelCrypto's ServiceProvider @@ -35,13 +35,13 @@ In order to activate this package, you need to replace Laravel's `EncryptionServ with `LaravelCryptoServiceProvider`. In `config/app.php` replace `Illuminate\Encryption\EncryptionServiceProvider::class` -with `BrosSquad\LaravelCrypto\ServiceProvider::class` +with `CodeLieutenant\LaravelCrypto\ServiceProvider::class` Depending on the laravel version you are using, you can do it in two ways. Laravel 9.0 and above: ```php -use BrosSquad\LaravelCrypto\ServiceProvider as LaravelCryptoServiceProvider; +use CodeLieutenant\LaravelCrypto\ServiceProvider as LaravelCryptoServiceProvider; use Illuminate\Encryption\EncryptionServiceProvider as LaravelEncryptionServiceProvider; // ... @@ -60,7 +60,7 @@ use Illuminate\Encryption\EncryptionServiceProvider as LaravelEncryptionServiceP Laravel 8.0: ```php -use BrosSquad\LaravelCrypto\ServiceProvider as LaravelCryptoServiceProvider; +use CodeLieutenant\LaravelCrypto\ServiceProvider as LaravelCryptoServiceProvider; 'providers' => [ // ... diff --git a/README.old.md b/README.old.md index bf53261..8f22ffc 100644 --- a/README.old.md +++ b/README.old.md @@ -60,7 +60,7 @@ $ composer require brossquad/laravel-crypto ### Publishing config file ```shell script -php artisan vendor:publish --provider="BrosSquad\LaravelCrypto\HashingServiceProvider" +php artisan vendor:publish --provider="CodeLieutenant\LaravelCrypto\HashingServiceProvider" ``` ### Generating EdDSA private and public key @@ -78,7 +78,7 @@ $ php artisan crypto:keys #### Base64 Encoding ```php -use BrosSquad\LaravelCrypto\Support\Base64; +use CodeLieutenant\LaravelCrypto\Support\Base64; $binaryData = random_bytes(32); @@ -134,7 +134,7 @@ $base64Length = Base64::encodedLength($bufferLength, $hasPadding); ### Generating random data ```php -use BrosSquad\LaravelCrypto\Support\Random; +use CodeLieutenant\LaravelCrypto\Support\Random; // Generate random string $randomString = Random::string(60); // Generates random string base64 url encoded with no padding @@ -155,7 +155,7 @@ Laravel crypto library uses the latest and best hashing algorithms. (Blake2b) ```php namespace App\Services; -use BrosSquad\LaravelCrypto\Facades\Hashing; +use CodeLieutenant\LaravelCrypto\Facades\Hashing; class Service { @@ -199,7 +199,7 @@ class Service ```php namespace App\Services; -use \BrosSquad\LaravelCrypto\Contracts\Hashing; +use \CodeLieutenant\LaravelCrypto\Contracts\Hashing; class Service { @@ -263,7 +263,7 @@ Read more on [HMAC](https://en.wikipedia.org/wiki/HMAC) namespace App\Service; -use BrosSquad\LaravelCrypto\Facades\Sign; +use CodeLieutenant\LaravelCrypto\Facades\Sign; class Service { @@ -297,7 +297,7 @@ class Service ```php namespace App\Service; -use BrosSquad\LaravelCrypto\Contracts\Signing; +use CodeLieutenant\LaravelCrypto\Contracts\Signing; class Service { @@ -346,7 +346,7 @@ Public key signing uses state of the art in public key cryptography -> EdDSA or namespace App\Service; -use BrosSquad\LaravelCrypto\Facades\EdDSA; +use CodeLieutenant\LaravelCrypto\Facades\EdDSA; class Service { @@ -381,7 +381,7 @@ class Service ```php namespace App\Service; -use BrosSquad\LaravelCrypto\Contracts\PublicKeySigning; +use CodeLieutenant\LaravelCrypto\Contracts\PublicKeySigning; class Service { diff --git a/benchmarks/Base64Bench.php b/benchmarks/Base64Bench.php index 5451d10..b01c41d 100644 --- a/benchmarks/Base64Bench.php +++ b/benchmarks/Base64Bench.php @@ -1,9 +1,9 @@ createSha256Driver()->verifyRaw($hash, $data); } - public function createSha256Driver(): \BrosSquad\LaravelCrypto\Hashing\Sha256 + public function createSha256Driver(): \CodeLieutenant\LaravelCrypto\Hashing\Sha256 { if ($this->sha256 === null) { $this->sha256 = $this->container->make(Sha256::class); diff --git a/src/Hashing/Traits/Sha512.php b/src/Hashing/Traits/Sha512.php index 478f4fd..f8d95a3 100644 --- a/src/Hashing/Traits/Sha512.php +++ b/src/Hashing/Traits/Sha512.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Hashing\Traits; +namespace CodeLieutenant\LaravelCrypto\Hashing\Traits; trait Sha512 { - private ?\BrosSquad\LaravelCrypto\Hashing\Sha512 $sha512 = null; + private ?\CodeLieutenant\LaravelCrypto\Hashing\Sha512 $sha512 = null; public function sha512(string $data): string { @@ -28,7 +28,7 @@ public function sha512VerifyRaw(string $hash, string $data): bool return $this->createSha512Driver()->verifyRaw($hash, $data); } - public function createSha512Driver(): \BrosSquad\LaravelCrypto\Hashing\Sha512 + public function createSha512Driver(): \CodeLieutenant\LaravelCrypto\Hashing\Sha512 { if ($this->sha512 === null) { $this->sha512 = $this->container->make(Sha512::class); diff --git a/src/Keys/AppKey.php b/src/Keys/AppKey.php index 51f2aff..addb45b 100644 --- a/src/Keys/AppKey.php +++ b/src/Keys/AppKey.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Keys; +namespace CodeLieutenant\LaravelCrypto\Keys; -use BrosSquad\LaravelCrypto\Encryption\AesGcm256Encryptor; -use BrosSquad\LaravelCrypto\Encryption\Encryption; -use BrosSquad\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor; +use CodeLieutenant\LaravelCrypto\Encryption\AesGcm256Encryptor; +use CodeLieutenant\LaravelCrypto\Encryption\Encryption; +use CodeLieutenant\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor; use Illuminate\Contracts\Config\Repository; use Illuminate\Encryption\Encrypter; diff --git a/src/Keys/Blake2bHashingKey.php b/src/Keys/Blake2bHashingKey.php index 69ad6d1..9d74117 100644 --- a/src/Keys/Blake2bHashingKey.php +++ b/src/Keys/Blake2bHashingKey.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Keys; +namespace CodeLieutenant\LaravelCrypto\Keys; -use BrosSquad\LaravelCrypto\Support\Random; +use CodeLieutenant\LaravelCrypto\Support\Random; use Illuminate\Contracts\Config\Repository; class Blake2bHashingKey extends AppKey diff --git a/src/Keys/EdDSASignerKey.php b/src/Keys/EdDSASignerKey.php index 5e2a678..d2524c9 100644 --- a/src/Keys/EdDSASignerKey.php +++ b/src/Keys/EdDSASignerKey.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Keys; +namespace CodeLieutenant\LaravelCrypto\Keys; use Illuminate\Contracts\Config\Repository; use Illuminate\Encryption\MissingAppKeyException; diff --git a/src/Keys/EnvKeySaver.php b/src/Keys/EnvKeySaver.php index 728c324..c1c7258 100644 --- a/src/Keys/EnvKeySaver.php +++ b/src/Keys/EnvKeySaver.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Keys; +namespace CodeLieutenant\LaravelCrypto\Keys; -use BrosSquad\LaravelCrypto\Support\Base64; +use CodeLieutenant\LaravelCrypto\Support\Base64; use RuntimeException; trait EnvKeySaver diff --git a/src/Keys/Generator.php b/src/Keys/Generator.php index bc75556..e5da178 100644 --- a/src/Keys/Generator.php +++ b/src/Keys/Generator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Keys; +namespace CodeLieutenant\LaravelCrypto\Keys; interface Generator { diff --git a/src/Keys/HmacKey.php b/src/Keys/HmacKey.php index 39e9def..1739e4d 100644 --- a/src/Keys/HmacKey.php +++ b/src/Keys/HmacKey.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Keys; +namespace CodeLieutenant\LaravelCrypto\Keys; class HmacKey extends Blake2bHashingKey diff --git a/src/Keys/LaravelKeyParser.php b/src/Keys/LaravelKeyParser.php index 9676e44..6abf2a0 100644 --- a/src/Keys/LaravelKeyParser.php +++ b/src/Keys/LaravelKeyParser.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Keys; +namespace CodeLieutenant\LaravelCrypto\Keys; -use BrosSquad\LaravelCrypto\Support\Base64; +use CodeLieutenant\LaravelCrypto\Support\Base64; use Illuminate\Encryption\MissingAppKeyException; use RuntimeException; diff --git a/src/Keys/Loader.php b/src/Keys/Loader.php index 01d9746..1668f10 100644 --- a/src/Keys/Loader.php +++ b/src/Keys/Loader.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Keys; +namespace CodeLieutenant\LaravelCrypto\Keys; interface Loader { diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index d9ef346..ec5c634 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -2,33 +2,33 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto; - -use BrosSquad\LaravelCrypto\Console\GenerateCryptoKeysCommand; -use BrosSquad\LaravelCrypto\Contracts\Hashing; -use BrosSquad\LaravelCrypto\Contracts\PublicKeySigning; -use BrosSquad\LaravelCrypto\Contracts\Signing; -use BrosSquad\LaravelCrypto\Encoder\IgbinaryEncoder; -use BrosSquad\LaravelCrypto\Encoder\JsonEncoder; -use BrosSquad\LaravelCrypto\Encoder\MessagePackEncoder; -use BrosSquad\LaravelCrypto\Encoder\PhpEncoder; -use BrosSquad\LaravelCrypto\Encryption\AesGcm256Encryptor; -use BrosSquad\LaravelCrypto\Encryption\Encryption; -use BrosSquad\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor; -use BrosSquad\LaravelCrypto\Hashing\Blake2b; -use BrosSquad\LaravelCrypto\Hashing\HashingManager; -use BrosSquad\LaravelCrypto\Hashing\Sha256; -use BrosSquad\LaravelCrypto\Hashing\Sha512; -use BrosSquad\LaravelCrypto\Keys\AppKey; -use BrosSquad\LaravelCrypto\Keys\Blake2bHashingKey; -use BrosSquad\LaravelCrypto\Keys\EdDSASignerKey; -use BrosSquad\LaravelCrypto\Keys\HmacKey; -use BrosSquad\LaravelCrypto\Keys\Loader; -use BrosSquad\LaravelCrypto\Signing\EdDSA\EdDSA; -use BrosSquad\LaravelCrypto\Signing\Hmac\Blake2b as HmacBlake2b; -use BrosSquad\LaravelCrypto\Signing\Hmac\Sha256 as HmacSha256; -use BrosSquad\LaravelCrypto\Signing\Hmac\Sha512 as HmacSha512; -use BrosSquad\LaravelCrypto\Signing\SigningManager; +namespace CodeLieutenant\LaravelCrypto; + +use CodeLieutenant\LaravelCrypto\Console\GenerateCryptoKeysCommand; +use CodeLieutenant\LaravelCrypto\Contracts\Hashing; +use CodeLieutenant\LaravelCrypto\Contracts\PublicKeySigning; +use CodeLieutenant\LaravelCrypto\Contracts\Signing; +use CodeLieutenant\LaravelCrypto\Encoder\IgbinaryEncoder; +use CodeLieutenant\LaravelCrypto\Encoder\JsonEncoder; +use CodeLieutenant\LaravelCrypto\Encoder\MessagePackEncoder; +use CodeLieutenant\LaravelCrypto\Encoder\PhpEncoder; +use CodeLieutenant\LaravelCrypto\Encryption\AesGcm256Encryptor; +use CodeLieutenant\LaravelCrypto\Encryption\Encryption; +use CodeLieutenant\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor; +use CodeLieutenant\LaravelCrypto\Hashing\Blake2b; +use CodeLieutenant\LaravelCrypto\Hashing\HashingManager; +use CodeLieutenant\LaravelCrypto\Hashing\Sha256; +use CodeLieutenant\LaravelCrypto\Hashing\Sha512; +use CodeLieutenant\LaravelCrypto\Keys\AppKey; +use CodeLieutenant\LaravelCrypto\Keys\Blake2bHashingKey; +use CodeLieutenant\LaravelCrypto\Keys\EdDSASignerKey; +use CodeLieutenant\LaravelCrypto\Keys\HmacKey; +use CodeLieutenant\LaravelCrypto\Keys\Loader; +use CodeLieutenant\LaravelCrypto\Signing\EdDSA\EdDSA; +use CodeLieutenant\LaravelCrypto\Signing\Hmac\Blake2b as HmacBlake2b; +use CodeLieutenant\LaravelCrypto\Signing\Hmac\Sha256 as HmacSha256; +use CodeLieutenant\LaravelCrypto\Signing\Hmac\Sha512 as HmacSha512; +use CodeLieutenant\LaravelCrypto\Signing\SigningManager; use Illuminate\Contracts\Config\Repository; use Illuminate\Contracts\Encryption\Encrypter; use Illuminate\Contracts\Foundation\Application; diff --git a/src/Signing/EdDSA/EdDSA.php b/src/Signing/EdDSA/EdDSA.php index 40685e3..d089bd5 100644 --- a/src/Signing/EdDSA/EdDSA.php +++ b/src/Signing/EdDSA/EdDSA.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Signing\EdDSA; +namespace CodeLieutenant\LaravelCrypto\Signing\EdDSA; -use BrosSquad\LaravelCrypto\Contracts\PublicKeySigning; -use BrosSquad\LaravelCrypto\Keys\Loader; -use BrosSquad\LaravelCrypto\Signing\Traits\Signing; -use BrosSquad\LaravelCrypto\Support\Base64; +use CodeLieutenant\LaravelCrypto\Contracts\PublicKeySigning; +use CodeLieutenant\LaravelCrypto\Keys\Loader; +use CodeLieutenant\LaravelCrypto\Signing\Traits\Signing; +use CodeLieutenant\LaravelCrypto\Support\Base64; final class EdDSA implements PublicKeySigning { use Signing; diff --git a/src/Signing/Hmac/Blake2b.php b/src/Signing/Hmac/Blake2b.php index b14d714..59cce22 100644 --- a/src/Signing/Hmac/Blake2b.php +++ b/src/Signing/Hmac/Blake2b.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Signing\Hmac; +namespace CodeLieutenant\LaravelCrypto\Signing\Hmac; -use BrosSquad\LaravelCrypto\Contracts\Signing as SigningContract; -use BrosSquad\LaravelCrypto\Keys\Loader; -use BrosSquad\LaravelCrypto\Signing\Traits\Signing; +use CodeLieutenant\LaravelCrypto\Contracts\Signing as SigningContract; +use CodeLieutenant\LaravelCrypto\Keys\Loader; +use CodeLieutenant\LaravelCrypto\Signing\Traits\Signing; final class Blake2b implements SigningContract { diff --git a/src/Signing/Hmac/Sha256.php b/src/Signing/Hmac/Sha256.php index a1ee0b3..28ba74d 100644 --- a/src/Signing/Hmac/Sha256.php +++ b/src/Signing/Hmac/Sha256.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Signing\Hmac; +namespace CodeLieutenant\LaravelCrypto\Signing\Hmac; -use BrosSquad\LaravelCrypto\Contracts\Signing as SigningContract; -use BrosSquad\LaravelCrypto\Keys\Loader; -use BrosSquad\LaravelCrypto\Signing\Traits\Signing; -use BrosSquad\LaravelCrypto\Support\Base64; +use CodeLieutenant\LaravelCrypto\Contracts\Signing as SigningContract; +use CodeLieutenant\LaravelCrypto\Keys\Loader; +use CodeLieutenant\LaravelCrypto\Signing\Traits\Signing; +use CodeLieutenant\LaravelCrypto\Support\Base64; final class Sha256 implements SigningContract { diff --git a/src/Signing/Hmac/Sha512.php b/src/Signing/Hmac/Sha512.php index 09beec5..17da930 100644 --- a/src/Signing/Hmac/Sha512.php +++ b/src/Signing/Hmac/Sha512.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Signing\Hmac; +namespace CodeLieutenant\LaravelCrypto\Signing\Hmac; -use BrosSquad\LaravelCrypto\Contracts\Signing as SigningContract; -use BrosSquad\LaravelCrypto\Keys\Loader; -use BrosSquad\LaravelCrypto\Signing\Traits\Signing; +use CodeLieutenant\LaravelCrypto\Contracts\Signing as SigningContract; +use CodeLieutenant\LaravelCrypto\Keys\Loader; +use CodeLieutenant\LaravelCrypto\Signing\Traits\Signing; final class Sha512 implements SigningContract { diff --git a/src/Signing/SigningManager.php b/src/Signing/SigningManager.php index add3fda..652b262 100644 --- a/src/Signing/SigningManager.php +++ b/src/Signing/SigningManager.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Signing; +namespace CodeLieutenant\LaravelCrypto\Signing; use Illuminate\Support\Manager; -use BrosSquad\LaravelCrypto\Contracts\Signing; +use CodeLieutenant\LaravelCrypto\Contracts\Signing; class SigningManager extends Manager implements Signing { diff --git a/src/Signing/Traits/Blake2b.php b/src/Signing/Traits/Blake2b.php index 3fc3b5f..7ac8302 100644 --- a/src/Signing/Traits/Blake2b.php +++ b/src/Signing/Traits/Blake2b.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Signing\Traits; +namespace CodeLieutenant\LaravelCrypto\Signing\Traits; trait Blake2b { - protected ?\BrosSquad\LaravelCrypto\Signing\Hmac\Blake2b $blake2b = null; + protected ?\CodeLieutenant\LaravelCrypto\Signing\Hmac\Blake2b $blake2b = null; public function blake2bSign(string $data): string { @@ -23,7 +23,7 @@ public function blake2bVerify(string $message, string $hmac): bool return $this->createBlake2bDriver()->verify($message, $hmac); } - public function createBlake2bDriver(): \BrosSquad\LaravelCrypto\Signing\Hmac\Blake2b + public function createBlake2bDriver(): \CodeLieutenant\LaravelCrypto\Signing\Hmac\Blake2b { if ($this->blake2b === null) { $this->blake2b = $this->container->get(Blake2b::class); diff --git a/src/Signing/Traits/EdDSA.php b/src/Signing/Traits/EdDSA.php index 18d8bbe..a99587e 100644 --- a/src/Signing/Traits/EdDSA.php +++ b/src/Signing/Traits/EdDSA.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Signing\Traits; +namespace CodeLieutenant\LaravelCrypto\Signing\Traits; trait EdDSA { - protected ?\BrosSquad\LaravelCrypto\Signing\EdDSA\EdDSA $eddsa = null; + protected ?\CodeLieutenant\LaravelCrypto\Signing\EdDSA\EdDSA $eddsa = null; public function eddsaSign(string $data): string { @@ -23,7 +23,7 @@ public function eddsaVerify(string $message, string $hmac): bool return $this->createEdDSADriver()->verify($message, $hmac); } - public function createEdDSADriver(): \BrosSquad\LaravelCrypto\Signing\EdDSA\EdDSA + public function createEdDSADriver(): \CodeLieutenant\LaravelCrypto\Signing\EdDSA\EdDSA { if ($this->eddsa === null) { $this->eddsa = $this->container->get(EdDSA::class); diff --git a/src/Signing/Traits/Hmac256.php b/src/Signing/Traits/Hmac256.php index 22be4d5..d441e5b 100644 --- a/src/Signing/Traits/Hmac256.php +++ b/src/Signing/Traits/Hmac256.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Signing\Traits; +namespace CodeLieutenant\LaravelCrypto\Signing\Traits; -use BrosSquad\LaravelCrypto\Signing\Hmac\Sha256; +use CodeLieutenant\LaravelCrypto\Signing\Hmac\Sha256; trait Hmac256 { diff --git a/src/Signing/Traits/Hmac512.php b/src/Signing/Traits/Hmac512.php index e9949ef..9170a7a 100644 --- a/src/Signing/Traits/Hmac512.php +++ b/src/Signing/Traits/Hmac512.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Signing\Traits; +namespace CodeLieutenant\LaravelCrypto\Signing\Traits; -use BrosSquad\LaravelCrypto\Signing\Hmac\Sha512; +use CodeLieutenant\LaravelCrypto\Signing\Hmac\Sha512; trait Hmac512 { diff --git a/src/Signing/Traits/Signing.php b/src/Signing/Traits/Signing.php index 8906843..3830f42 100644 --- a/src/Signing/Traits/Signing.php +++ b/src/Signing/Traits/Signing.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Signing\Traits; +namespace CodeLieutenant\LaravelCrypto\Signing\Traits; -use BrosSquad\LaravelCrypto\Support\Base64; -use BrosSquad\LaravelCrypto\Traits\ConstantTimeCompare; +use CodeLieutenant\LaravelCrypto\Support\Base64; +use CodeLieutenant\LaravelCrypto\Traits\ConstantTimeCompare; trait Signing { diff --git a/src/Support/Base64.php b/src/Support/Base64.php index e752511..3095460 100644 --- a/src/Support/Base64.php +++ b/src/Support/Base64.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Support; +namespace CodeLieutenant\LaravelCrypto\Support; final class Base64 { diff --git a/src/Support/Random.php b/src/Support/Random.php index 7b1b45c..cb7f72c 100644 --- a/src/Support/Random.php +++ b/src/Support/Random.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Support; +namespace CodeLieutenant\LaravelCrypto\Support; final class Random { diff --git a/src/Support/Random82.php b/src/Support/Random82.php index b763589..c53716b 100644 --- a/src/Support/Random82.php +++ b/src/Support/Random82.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Support; +namespace CodeLieutenant\LaravelCrypto\Support; use Random\Randomizer; diff --git a/src/Traits/ConstantTimeCompare.php b/src/Traits/ConstantTimeCompare.php index 2a1a4a7..5822092 100644 --- a/src/Traits/ConstantTimeCompare.php +++ b/src/Traits/ConstantTimeCompare.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Traits; +namespace CodeLieutenant\LaravelCrypto\Traits; trait ConstantTimeCompare { diff --git a/testbench.yaml b/testbench.yaml index c2c6e2f..a43fde0 100644 --- a/testbench.yaml +++ b/testbench.yaml @@ -1,5 +1,5 @@ providers: - - BrosSquad\LaravelCrypto\ServiceProvider + - CodeLieutenant\LaravelCrypto\ServiceProvider - Workbench\App\Providers\WorkbenchServiceProvider workbench: diff --git a/tests/Feature/Encryption/AesGcm256EncryptorTest.php b/tests/Feature/Encryption/AesGcm256EncryptorTest.php index ac71f24..71c7e54 100644 --- a/tests/Feature/Encryption/AesGcm256EncryptorTest.php +++ b/tests/Feature/Encryption/AesGcm256EncryptorTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Encryption\AesGcm256Encryptor; +use CodeLieutenant\LaravelCrypto\Encryption\AesGcm256Encryptor; it('should encrypt/decrypt data', function (bool $serialize) { $encryptor = new AesGcm256Encryptor(inMemoryKeyLoader()); diff --git a/tests/Feature/Encryption/XChaCha20Poly1305EncryptorTest.php b/tests/Feature/Encryption/XChaCha20Poly1305EncryptorTest.php index c11edbc..4b4b1e6 100644 --- a/tests/Feature/Encryption/XChaCha20Poly1305EncryptorTest.php +++ b/tests/Feature/Encryption/XChaCha20Poly1305EncryptorTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor; +use CodeLieutenant\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor; it('should encrypt/decrypt data', function (bool $serialize) { $encryptor = new XChaCha20Poly1305Encryptor(inMemoryKeyLoader()); diff --git a/tests/Feature/ServiceProviderLoadingTest.php b/tests/Feature/ServiceProviderLoadingTest.php index 133d3d2..dbfc637 100644 --- a/tests/Feature/ServiceProviderLoadingTest.php +++ b/tests/Feature/ServiceProviderLoadingTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Encryption\AesGcm256Encryptor; -use BrosSquad\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor; +use CodeLieutenant\LaravelCrypto\Encryption\AesGcm256Encryptor; +use CodeLieutenant\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor; use Illuminate\Encryption\Encrypter; use Illuminate\Support\Facades\Config; -use BrosSquad\LaravelCrypto\Encryption\Encryption; +use CodeLieutenant\LaravelCrypto\Encryption\Encryption; test('encrypter resolver', function (string $cipher, string $instance) { Config::set('app.cipher', $cipher); diff --git a/tests/InMemoryAppKeyLoader.php b/tests/InMemoryAppKeyLoader.php index 1f954a0..9ab420f 100644 --- a/tests/InMemoryAppKeyLoader.php +++ b/tests/InMemoryAppKeyLoader.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Tests; +namespace CodeLieutenant\LaravelCrypto\Tests; -use BrosSquad\LaravelCrypto\Keys\Loader; +use CodeLieutenant\LaravelCrypto\Keys\Loader; use Illuminate\Support\Str; class InMemoryAppKeyLoader implements Loader diff --git a/tests/Pest.php b/tests/Pest.php index 0f10d3b..d88d3d4 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Tests\InMemoryAppKeyLoader; -use BrosSquad\LaravelCrypto\Tests\TestCase; -use BrosSquad\LaravelCrypto\Keys\Loader; +use CodeLieutenant\LaravelCrypto\Tests\InMemoryAppKeyLoader; +use CodeLieutenant\LaravelCrypto\Tests\TestCase; +use CodeLieutenant\LaravelCrypto\Keys\Loader; uses(TestCase::class)->in(__DIR__); diff --git a/tests/TestCase.php b/tests/TestCase.php index 013e282..fc53b48 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace BrosSquad\LaravelCrypto\Tests; +namespace CodeLieutenant\LaravelCrypto\Tests; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -20,7 +20,7 @@ abstract class TestCase extends BaseTestCase protected function getPackageProviders($app) { return [ - \BrosSquad\LaravelCrypto\ServiceProvider::class, + \CodeLieutenant\LaravelCrypto\ServiceProvider::class, ]; } } diff --git a/tests/Unit/Encoders/IgbinaryEncoderTest.php b/tests/Unit/Encoders/IgbinaryEncoderTest.php index ad7a3de..cdc3a61 100644 --- a/tests/Unit/Encoders/IgbinaryEncoderTest.php +++ b/tests/Unit/Encoders/IgbinaryEncoderTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Encoder\IgbinaryEncoder; +use CodeLieutenant\LaravelCrypto\Encoder\IgbinaryEncoder; test('encode', function () { $encoder = new IgbinaryEncoder(); diff --git a/tests/Unit/Encoders/JsonEncoderTest.php b/tests/Unit/Encoders/JsonEncoderTest.php index cf061b6..36052c2 100644 --- a/tests/Unit/Encoders/JsonEncoderTest.php +++ b/tests/Unit/Encoders/JsonEncoderTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Encoder\JsonEncoder; +use CodeLieutenant\LaravelCrypto\Encoder\JsonEncoder; test('encode', function () { $encoder = new JsonEncoder(); diff --git a/tests/Unit/Encoders/PhpEncoderTest.php b/tests/Unit/Encoders/PhpEncoderTest.php index c281b58..565b68e 100644 --- a/tests/Unit/Encoders/PhpEncoderTest.php +++ b/tests/Unit/Encoders/PhpEncoderTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Encoder\PhpEncoder; +use CodeLieutenant\LaravelCrypto\Encoder\PhpEncoder; test('encode', function () { $encoder = new PhpEncoder(); diff --git a/tests/Unit/Encryption/CryptoTraitTest.php b/tests/Unit/Encryption/CryptoTraitTest.php index 9429864..2734e5d 100644 --- a/tests/Unit/Encryption/CryptoTraitTest.php +++ b/tests/Unit/Encryption/CryptoTraitTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Encryption\Crypto; -use BrosSquad\LaravelCrypto\Encryption\Encryption; +use CodeLieutenant\LaravelCrypto\Encryption\Crypto; +use CodeLieutenant\LaravelCrypto\Encryption\Encryption; class TestTraitImpl { diff --git a/tests/Unit/Hashing/Blake2bTest.php b/tests/Unit/Hashing/Blake2bTest.php index 4f96741..e18abfb 100644 --- a/tests/Unit/Hashing/Blake2bTest.php +++ b/tests/Unit/Hashing/Blake2bTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Hashing\Blake2b; +use CodeLieutenant\LaravelCrypto\Hashing\Blake2b; function bcryptHash(string $value, string $key, int $outputLength = 32): string { diff --git a/tests/Unit/Hashing/Sha256Test.php b/tests/Unit/Hashing/Sha256Test.php index 957afa7..4fecdd4 100644 --- a/tests/Unit/Hashing/Sha256Test.php +++ b/tests/Unit/Hashing/Sha256Test.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Hashing\Sha256; +use CodeLieutenant\LaravelCrypto\Hashing\Sha256; function hash256(string $value): string { diff --git a/tests/Unit/Hashing/Sha512Test.php b/tests/Unit/Hashing/Sha512Test.php index 98a2639..cda5185 100644 --- a/tests/Unit/Hashing/Sha512Test.php +++ b/tests/Unit/Hashing/Sha512Test.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Hashing\Sha512; +use CodeLieutenant\LaravelCrypto\Hashing\Sha512; function hash512(string $value): string { diff --git a/tests/Unit/Support/Base64Test.php b/tests/Unit/Support/Base64Test.php index 06ef6a2..43ed932 100644 --- a/tests/Unit/Support/Base64Test.php +++ b/tests/Unit/Support/Base64Test.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use BrosSquad\LaravelCrypto\Support\Base64; +use CodeLieutenant\LaravelCrypto\Support\Base64; it('encodes binary data', function () { $data = random_bytes(32); diff --git a/workbench/config/app.php b/workbench/config/app.php index edf9d43..98500fa 100644 --- a/workbench/config/app.php +++ b/workbench/config/app.php @@ -1,6 +1,6 @@ ServiceProvider::defaultProviders() ->replace([ - EncryptionServiceProvider::class => BrosSquad\LaravelCrypto\ServiceProvider::class, + EncryptionServiceProvider::class => CodeLieutenant\LaravelCrypto\ServiceProvider::class, ]) ->merge([ WorkbenchServiceProvider::class,