Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 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
0a50743
sln dir variable is empty in dotnet cli
ChrisMcKee Feb 17, 2026
ae20b29
Nerdbank.GitVersioning moved
ChrisMcKee Feb 17, 2026
de04ed7
stop codeql mithering about benchmark code
ChrisMcKee Feb 17, 2026
77237c6
actions
ChrisMcKee Feb 17, 2026
6b3e5f1
Merge branch 'main' into ReadonlySpanSupport
ChrisMcKee Feb 17, 2026
84dff64
Split targeting
ChrisMcKee Feb 17, 2026
349962f
actions pinning
ChrisMcKee Feb 17, 2026
357ac9c
codeql target
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/**"
27 changes: 27 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-coverage": {
"version": "18.1.0",
"commands": [
"dotnet-coverage"
],
"rollForward": false
},
"dotnet-stryker": {
"version": "4.12.0",
"commands": [
"dotnet-stryker"
],
"rollForward": false
},
"docfx": {
"version": "2.78.4",
"commands": [
"docfx"
],
"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
6 changes: 6 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
paths:
- 'src'
paths-ignore:
- '**/examples/**'
- '**/benchmarks/**'
- '**/tests/**'
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"
106 changes: 106 additions & 0 deletions .github/workflows/ci-build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: CI PR Build

on:
workflow_dispatch:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
- '.github/**'
pull_request:
branches:
- 'main'
paths-ignore:
- 'docs/**'
- '.github/**'


permissions:
contents: read
issues: read
pull-requests: write
checks: write

env:
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

jobs:
build:
name: Build and Test
runs-on: ubuntu-24.04
steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit

- name: 'Checkout'
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@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
with:
dotnet-version: 10.x

- name: 'Restore external dependencies'
run: dotnet restore

- name: 'Build'
id: build
run: dotnet build --configuration Debug --no-restore

- name: 'Test'
id: test
run: dotnet run --configuration Release --coverage --coverage-output-format cobertura --report-github --project tests/UnitTests/BCrypt.Net.UnitTests.csproj

- name: 'Generate Coverage Reports'
uses: danielpalme/ReportGenerator-GitHub-Action@c4c5175a441c6603ec614f5084386dabe0e2295b # v5.4.12
with:
reports: "tests/**/*.cobertura.xml"
targetdir: "${{ github.workspace }}"
reporttypes: "Cobertura"
verbosity: "Info"
title: "Code Coverage"
tag: "${{ github.run_number }}_${{ github.run_id }}"
toolpath: "reportgeneratortool"
license: ${{ secrets.REPORT_GENERATOR_LICENSE }}

- name: Publish Code Coverage Report
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
with:
filename: "Cobertura.xml"
badge: true
fail_below_min: false # just informative for now
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: "10 30"

- name: Upload Code Coverage Results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-results
path: |
${{ github.workspace }}/Cobertura.xml
${{ github.workspace }}/code-coverage-results.md
retention-days: 5

- name: Publish Test Results
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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-results
path: "tests/**/TestResults.xml"
retention-days: 5
21 changes: 8 additions & 13 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ on:
paths-ignore:
- 'docs/**'
- '.github/**'
pull_request:
branches:
- 'main'


permissions:
contents: read
Expand All @@ -29,19 +27,19 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.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@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
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 @@ -56,14 +54,11 @@ jobs:
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 --restore --collect:"XPlat Code Coverage" --logger junit --configuration Debug
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
Expand All @@ -73,9 +68,9 @@ jobs:
if: always()

- name: 'Generate Coverage Reports'
uses: danielpalme/ReportGenerator-GitHub-Action@cc137d2b561c02b63ae869ffbe8f68af9d904bf4 # 5.4.6
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 Down
121 changes: 0 additions & 121 deletions .github/workflows/ci-manual-build-test-sign.yml

This file was deleted.

Loading
Loading