Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
85f65ed
feat: validate input set; don't allow passwords exceeding max bCrypt …
ChrisMcKee Apr 1, 2025
d3112f1
feat: Add/Update overloads so we're utilising the allocated buffer re…
ChrisMcKee Apr 1, 2025
d91243e
feat: move the legacy pre-span code into its own file instead
ChrisMcKee Apr 1, 2025
c07bce0
fix: xmldoc
ChrisMcKee Apr 1, 2025
671dfe3
chore: cleanup benchmarks
ChrisMcKee Apr 1, 2025
6d352ed
rejig
ChrisMcKee Apr 2, 2025
a464094
Benchmarks
ChrisMcKee Apr 2, 2025
b1059a2
Switch func to a bog standard delegate (looks neater in compiler stat…
ChrisMcKee Apr 2, 2025
8892e94
Work in progress
ChrisMcKee May 7, 2025
87c54dc
chore: bulk package/actions update
ChrisMcKee May 7, 2025
e0172f6
feat: Memory safety changes
ChrisMcKee Sep 8, 2025
edbb46f
.net 10
ChrisMcKee Nov 11, 2025
fda407c
chore: cleanup
ChrisMcKee Nov 12, 2025
ee7982e
chore: packages
ChrisMcKee Nov 12, 2025
2925c1a
chore: jiggling benchmark to bloody work
ChrisMcKee Nov 12, 2025
b5fabe6
chore: use built in compiler flags
ChrisMcKee Nov 12, 2025
aea4f72
rm old app
ChrisMcKee Nov 12, 2025
7696287
Compiler statements change to lump standard in with framework; not su…
ChrisMcKee Nov 12, 2025
8ea268d
benchmark fettling
ChrisMcKee Nov 12, 2025
4dc0e53
Add a smaller benchmark project for comparing releases; this will all…
ChrisMcKee Nov 12, 2025
f86f927
Add netstandard supporting code back in
ChrisMcKee Nov 12, 2025
5300270
more benchmark/compiler statement fiddling
ChrisMcKee Nov 12, 2025
3ffa1ba
more benchmark fettling so I dont have to set the version in multiple…
ChrisMcKee Nov 12, 2025
79a8a63
csproj faf, nest files
ChrisMcKee Nov 12, 2025
9f025f1
Benchy sans boat
ChrisMcKee Nov 12, 2025
68e4e31
benchmark faffing with csproj defaults
ChrisMcKee Nov 12, 2025
4ff7db5
Remove pre net462 (minimum viable System.Memory package support)
ChrisMcKee Nov 13, 2025
c9a1f59
chore: package updates
ChrisMcKee Feb 16, 2026
73bb74c
chore: actions versions
ChrisMcKee Feb 16, 2026
2a3554e
rem net9
ChrisMcKee Feb 16, 2026
56ff344
xunit woes
ChrisMcKee Feb 16, 2026
2ab4526
correct access DecodeBase64
ChrisMcKee Feb 16, 2026
1af6d41
feat: `ZeroMemory` method for uint buffer
ChrisMcKee Feb 16, 2026
4d45c06
feat: in `CryptRaw` on final zero `_p` and `_s`
ChrisMcKee Feb 16, 2026
81fb9a4
feat: EncodeBase64 was creating 3 alloc / hash
ChrisMcKee Feb 16, 2026
c12eb46
BCryptExtendedV3 - zero bytes/hash before completion
ChrisMcKee Feb 16, 2026
0b5dbe9
BCryptExtendedV3 reduce allocations
ChrisMcKee Feb 16, 2026
18197eb
BCryptExtendedV3 squeeze currentWorkFactor
ChrisMcKee Feb 16, 2026
929580d
perf: change EnhancedHashDelegate to take a dest
ChrisMcKee Feb 16, 2026
8e8c524
test: add tests for ident extension
ChrisMcKee Feb 16, 2026
502fd8e
Signing faff and its a damn faff
ChrisMcKee Feb 16, 2026
5d3dc07
fixup ReleaseBenchmark
ChrisMcKee Feb 16, 2026
31640f7
ca1850: BCryptExtendedV2
ChrisMcKee Feb 16, 2026
6915fba
cdoc
ChrisMcKee Feb 16, 2026
4a7351c
add very simple benchmark to simplify allocation runs
ChrisMcKee Feb 16, 2026
a1dcb71
Move validation of input length to HashType.None
ChrisMcKee Feb 16, 2026
83d7798
feat: ThreadLocal<uint[]> _p/_s key
ChrisMcKee Feb 16, 2026
4c52fb3
Tests over length by byte change
ChrisMcKee Feb 16, 2026
5eb6f11
fix: zeroing
ChrisMcKee Feb 16, 2026
d2b7617
Actualls save file for tests over length by byte change
ChrisMcKee Feb 16, 2026
471aef2
Shift fwk length check in similar fashion
ChrisMcKee Feb 16, 2026
700065e
belts and braces test
ChrisMcKee Feb 16, 2026
ff57e08
docs
ChrisMcKee Feb 17, 2026
a031fd3
stryker-config
ChrisMcKee Feb 17, 2026
19740a0
chore: reorg folder
ChrisMcKee Feb 17, 2026
6ebe008
Chores and warnings
ChrisMcKee Feb 17, 2026
fb39a4d
chore: metadata
ChrisMcKee Feb 17, 2026
b7ae3b8
correct project name
ChrisMcKee Feb 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
exclude_paths:
- ".github/**"
- ".config/**"
- "coverage/**"
- "vendor/**"
- "docs/**"
- "examples/**"
- "assets/**"
- "tests/**"
- "benchmarks/**"
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-stryker": {
"version": "4.12.0",
"commands": [
"dotnet-stryker"
],
"rollForward": false
}
}
}
3 changes: 1 addition & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@ csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true


file_header_template = /*\nThe MIT License (MIT)\nCopyright (c) 2006 Damien Miller djm@mindrot.org (jBCrypt)\nCopyright (c) 2013 Ryan D. Emerle (.Net port)\nCopyright (c) 2016/2025 Chris McKee (.Net-core port / patches / new features)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files\n(the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,\nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n*/
file_header_template = /*\nThe MIT License (MIT)\nCopyright (c) 2006 Damien Miller djm@mindrot.org (jBCrypt)\nCopyright (c) 2013 Ryan D. Emerle (.Net port)\nCopyright (c) 2016 Chris McKee (.Net-core port / patches / new features)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files\n(the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,\nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n*/
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @chrismckee
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ updates:
update-types: ["version-update:semver-major"]
- dependency-name: "System.Runtime.Caching"
update-types: ["version-update:semver-major"]
reviewers:
- "chrismckee"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "chrismckee"
27 changes: 12 additions & 15 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: 'Checkout'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- name: 'Setup .NET SDK'
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: 'Restore external dependencies'
run: dotnet restore
Expand All @@ -51,31 +51,28 @@ jobs:
run: dotnet build --configuration Debug --no-restore

- name: Upload Build Artifacts
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: build-artifacts
path: |
src/**/BCrypt.*.nupkg
src/**/BCrypt.*.dll
src/**/BCrypt.*.deps.json
src/**/BCrypt.*.xml
retention-days: 5

- name: 'Test'
id: test
run: dotnet test --no-build --restore --collect:"XPlat Code Coverage" --logger junit tests/UnitTests/BCrypt.Net.UnitTests.csproj
run: dotnet run --configuration Release --coverage --coverage-output-format cobertura --report-github --project tests/UnitTests/BCrypt.Net.UnitTests.csproj

- name: 'Create test summary'
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: tests/**/TestResults.xml
paths: tests/UnitTests/**/TestResults.xml
show: "fail, skip"
if: always()

- name: 'Generate Coverage Reports'
uses: danielpalme/ReportGenerator-GitHub-Action@c38c522d4b391c1b0da979cbb2e902c0a252a7dc # 5.4.3
uses: danielpalme/ReportGenerator-GitHub-Action@c4c5175a441c6603ec614f5084386dabe0e2295b # v5.4.12
with:
reports: "tests/**/coverage.cobertura.xml"
reports: "tests/**/*.cobertura.xml"
targetdir: "${{ github.workspace }}"
reporttypes: "Cobertura"
verbosity: "Info"
Expand All @@ -98,7 +95,7 @@ jobs:
thresholds: "10 30"

- name: Upload Code Coverage Results
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-results
path: |
Expand All @@ -107,13 +104,13 @@ jobs:
retention-days: 5

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
uses: EnricoMi/publish-unit-test-result-action@afb2984f4d89672b2f9d9c13ae23d53779671984 # v2.19.0
if: always()
with:
files: "tests/**/TestResults.xml"

- name: Upload Test Artifacts
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-results
path: "tests/**/TestResults.xml"
Expand Down
168 changes: 0 additions & 168 deletions .github/workflows/ci-manual-build-test-sign.yml

This file was deleted.

14 changes: 8 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'assets/*'
- 'examples/*'
- 'dists/*'
- 'benchmarks/*'
pull_request:
# The branches below must be a subset of the branches above
branches:
Expand All @@ -23,6 +24,7 @@ on:
- 'assets/*'
- 'examples/*'
- 'dists/*'
- 'benchmarks/*'
schedule:
- cron: '25 4 * * 2'

Expand All @@ -49,23 +51,23 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: 'Checkout repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- name: 'Setup .NET SDK'
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@d68b2d4edb4189fd2a5366ac14e72027bd4b37dd # v3.28.2
uses: github/codeql-action/init@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3.30.2
with:
languages: ${{ matrix.language }}

Expand All @@ -75,4 +77,4 @@ jobs:
- run: dotnet build --configuration CodeQL /p:UseSharedCompilation=false /t:rebuild

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@d68b2d4edb4189fd2a5366ac14e72027bd4b37dd # v3.28.2
uses: github/codeql-action/analyze@d3678e237b9c32a6c9bffb3315c335f976f3549f ## v3.30.2
6 changes: 3 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: 'Dependency Review'
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3
2 changes: 1 addition & 1 deletion .github/workflows/devskim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@v4
Expand Down
Loading