Skip to content

Commit

Permalink
Merge branch 'master' into ios
Browse files Browse the repository at this point in the history
  • Loading branch information
ektrah committed Apr 27, 2024
2 parents 493f292 + f21196a commit c106e4c
Show file tree
Hide file tree
Showing 45 changed files with 2,308 additions and 117 deletions.
69 changes: 35 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ jobs:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- name: Set up .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- run: dotnet --info
- uses: actions/checkout@v3
- name: Test (.NET 7.0/Debug)
run: dotnet test tests -f net7.0 -c Debug
- name: Test (.NET 7.0/Release)
run: dotnet test tests -f net7.0 -c Release
- uses: actions/checkout@v4
- name: Test (.NET 8.0/Debug)
run: dotnet test tests -f net8.0 -c Debug
- name: Test (.NET 8.0/Release)
run: dotnet test tests -f net8.0 -c Release
- name: Test (.NET 6.0/Debug)
run: dotnet test tests -f net6.0 -c Debug
- name: Test (.NET 6.0/Release)
run: dotnet test tests -f net6.0 -c Release
- name: Pack
run: dotnet pack -c Release
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: '**/*.nupkg'

Expand All @@ -39,26 +39,26 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-11
- os: macos-12
- os: macos-13
- os: macos-14
runs-on: ${{ matrix.os }}
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- name: Set up .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- run: dotnet --info
- uses: actions/checkout@v3
- name: Test (.NET 7.0/Debug)
run: dotnet test tests -f net7.0 -c Debug
- name: Test (.NET 7.0/Release)
run: dotnet test tests -f net7.0 -c Release
- uses: actions/checkout@v4
- name: Test (.NET 8.0/Debug)
run: dotnet test tests -f net8.0 -c Debug
- name: Test (.NET 8.0/Release)
run: dotnet test tests -f net8.0 -c Release
- name: Test (.NET 6.0/Debug)
run: dotnet test tests -f net6.0 -c Debug
- name: Test (.NET 6.0/Release)
Expand All @@ -70,15 +70,15 @@ jobs:
fail-fast: false
matrix:
include:
- os: centos:7
- os: debian:10
- os: debian:11
- os: fedora:37
- os: debian:12
- os: fedora:38
- os: ubuntu:16.04
- os: ubuntu:18.04
- os: fedora:39
- os: fedora:40
- os: ubuntu:20.04
- os: ubuntu:22.04
- os: ubuntu:24.04
runs-on: ubuntu-latest
container:
image: ${{ matrix.os }}
Expand All @@ -99,17 +99,17 @@ jobs:
run: apt-get -qq update && apt-get -qq install --yes --no-install-recommends curl ca-certificates gettext
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- name: Set up .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- run: dotnet --info
- uses: actions/checkout@v3
- name: Test (.NET 7.0/Debug)
run: dotnet test tests -f net7.0 -c Debug
- name: Test (.NET 7.0/Release)
run: dotnet test tests -f net7.0 -c Release
- uses: actions/checkout@v4
- name: Test (.NET 8.0/Debug)
run: dotnet test tests -f net8.0 -c Debug
- name: Test (.NET 8.0/Release)
run: dotnet test tests -f net8.0 -c Release
- name: Test (.NET 6.0/Debug)
run: dotnet test tests -f net6.0 -c Debug
- name: Test (.NET 6.0/Release)
Expand All @@ -120,17 +120,18 @@ jobs:
fail-fast: false
matrix:
include:
- os: alpine3.17
- os: alpine3.18
- os: alpine3.19
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/sdk:7.0-${{ matrix.os }}
image: mcr.microsoft.com/dotnet/sdk:8.0-${{ matrix.os }}
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- run: dotnet --info
- uses: actions/checkout@v3
- name: Test (.NET 7.0/Debug)
run: dotnet test tests -f net7.0 -c Debug
- name: Test (.NET 7.0/Release)
run: dotnet test tests -f net7.0 -c Release
- uses: actions/checkout@v4
- name: Test (.NET 8.0/Debug)
run: dotnet test tests -f net8.0 -c Debug
- name: Test (.NET 8.0/Release)
run: dotnet test tests -f net8.0 -c Release
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Klaus Hartke
Copyright (c) 2024 Klaus Hartke

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ License Notice for libsodium
This software is based on and contains code derived from libsodium, which is
available under the ISC license.

Copyright (c) 2013-2023 Frank Denis
Copyright (c) 2013-2024 Frank Denis

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
3 changes: 3 additions & 0 deletions NSec.sln
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{F058E702-CA9
docs\api\nsec.cryptography.hashalgorithm.md = docs\api\nsec.cryptography.hashalgorithm.md
docs\api\nsec.cryptography.incrementalhash.md = docs\api\nsec.cryptography.incrementalhash.md
docs\api\nsec.cryptography.incrementalmac.md = docs\api\nsec.cryptography.incrementalmac.md
docs\api\nsec.cryptography.incrementalsignature.md = docs\api\nsec.cryptography.incrementalsignature.md
docs\api\nsec.cryptography.incrementalsignatureverification.md = docs\api\nsec.cryptography.incrementalsignatureverification.md
docs\api\nsec.cryptography.key.md = docs\api\nsec.cryptography.key.md
docs\api\nsec.cryptography.keyagreementalgorithm.md = docs\api\nsec.cryptography.keyagreementalgorithm.md
docs\api\nsec.cryptography.keyblobformat.md = docs\api\nsec.cryptography.keyblobformat.md
Expand All @@ -78,6 +80,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{F058E702-CA9
docs\api\nsec.cryptography.sharedsecretblobformat.md = docs\api\nsec.cryptography.sharedsecretblobformat.md
docs\api\nsec.cryptography.sharedsecretcreationparameters.md = docs\api\nsec.cryptography.sharedsecretcreationparameters.md
docs\api\nsec.cryptography.signaturealgorithm.md = docs\api\nsec.cryptography.signaturealgorithm.md
docs\api\nsec.cryptography.signaturealgorithm2.md = docs\api\nsec.cryptography.signaturealgorithm2.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{030978CE-A451-4F42-887C-1B200DF7211C}"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# NSec

[![Maintenance](https://img.shields.io/maintenance/yes/2023)](https://github.com/ektrah/nsec)
[![Maintenance](https://img.shields.io/maintenance/yes/2024)](https://github.com/ektrah/nsec)
[![License](https://img.shields.io/github/license/ektrah/nsec)](https://nsec.rocks/license)
[![NuGet](https://img.shields.io/nuget/vpre/NSec.Cryptography)](https://www.nuget.org/packages/NSec.Cryptography/23.5.0-preview.1)
[![NuGet](https://img.shields.io/nuget/vpre/NSec.Cryptography)](https://www.nuget.org/packages/NSec.Cryptography/24.4.0)

[NSec](https://nsec.rocks/) is a cryptographic library for
[.NET 6+](https://dotnet.microsoft.com/) based on
Expand Down
4 changes: 2 additions & 2 deletions build/Package.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<PropertyGroup>
<!--<Version Condition="'$(Version)' == ''">23.5.0-preview.1</Version>-->
<Version Condition="'$(Version)' == ''">$([System.DateTime]::UtcNow.ToString(y.M.0))-preview.2-$(BuildNumberMajor)-$(BuildNumberMinor)</Version>
<!--<Version Condition="'$(Version)' == ''">24.4.0</Version>-->
<Version Condition="'$(Version)' == ''">$([System.DateTime]::UtcNow.ToString(y.M.0))-preview.1-$(BuildNumberMajor)-$(BuildNumberMinor)</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
33 changes: 25 additions & 8 deletions docs/api/nsec.cryptography.aeadalgorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Represents an authenticated encryption with associated data (AEAD) algorithm.

* [[Algorithm|Algorithm Class]]
* **AeadAlgorithm**
* Aegis128L
* Aegis256
* Aes256Gcm
* ChaCha20Poly1305
* XChaCha20Poly1305
Expand All @@ -20,6 +22,20 @@ Represents an authenticated encryption with associated data (AEAD) algorithm.
## Static Properties


### Aegis128L

Gets the AEGIS-128L AEAD algorithm.

public static Aegis128L Aegis128L { get; }


### Aegis256

Gets the AEGIS-256 AEAD algorithm.

public static Aegis256 Aegis256 { get; }


### Aes256Gcm

Gets the AES256-GCM AEAD algorithm.
Expand All @@ -33,10 +49,9 @@ PlatformNotSupportedException

#### Remarks

The implementation of AES-GCM in NSec is hardware-accelerated and requires an
x64 processor with the AES-NI extension. The availability of this extension can
be determined at runtime using the static `IsSupported` property of the
`NSec.Cryptography.Aes256Gcm` class.
The AES-GCM implementation in NSec is hardware-accelerated and may not be
available on all architectures. Support can be determined at runtime using
the static `IsSupported` property of the `NSec.Cryptography.Aes256Gcm` class.


### ChaCha20Poly1305
Expand Down Expand Up @@ -121,8 +136,9 @@ nonce
catastrophic loss of security.

: To prevent nonce reuse when encrypting multiple plaintexts with the same key,
it is recommended to increment the previous nonce; a randomly generated
nonce is not suitable.
it is recommended to increment the previous nonce. A randomly generated
nonce is unsafe unless the [[nonce size|AeadAlgorithm Class#NonceSize]]
is at least 24 bytes.

associatedData
: Optional additional data to be authenticated during decryption.
Expand Down Expand Up @@ -184,8 +200,9 @@ nonce
catastrophic loss of security.

: To prevent nonce reuse when encrypting multiple plaintexts with the same key,
it is recommended to increment the previous nonce; a randomly generated
nonce is not suitable.
it is recommended to increment the previous nonce. A randomly generated
nonce is unsafe unless the [[nonce size|AeadAlgorithm Class#NonceSize]]
is at least 24 bytes.

associatedData
: Optional additional data to be authenticated during decryption.
Expand Down
3 changes: 3 additions & 0 deletions docs/api/nsec.cryptography.algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ This class has no public members.

* **Algorithm**
* [[AeadAlgorithm|AeadAlgorithm Class]]
* Aegis128L
* Aegis256
* Aes256Gcm
* ChaCha20Poly1305
* XChaCha20Poly1305
* [[HashAlgorithm|HashAlgorithm Class]]
* Blake2b
* Sha256
Expand Down
Loading

0 comments on commit c106e4c

Please sign in to comment.