Граф коммитов

16 Коммитов

Автор SHA1 Сообщение Дата
Samuel Lee 977ec1e5f0 Merged PR 11273883: Implement ML-KEM
## Description:

+ Adds ML-KEM API surface
+ Implements the API with initial C implementation, with sprinkling of SSE/NEON for (I)NTT
+ Adds low level ML-KEM polynomial arithmetic testing which tests self-consistency and exercises internal assertion in debug builds
+ Adds multi-implementation functionality testing to enable comparative functionality and performance testing on E2E functionality
  + For now, comparison testing is just between SymCrypt static and dynamic, with 3rd party comparison with libcrux disabled until they publish a final ML-KEM implementation
+ Adds ML-KEM KATs from NIST

Related work items: #50913735
2024-08-31 02:53:41 +00:00
Mitch Lindgren 🦎 3b4cad7a6a Merged PR 11324214: FIPS 140-3 CASTs for RSA, DSA, ECDSA
This change adds additional Cryptographic Algorithm Self-Tests (CASTs) for RSA, DSA and ECDSA. as required by FIPS 140-3. Specifically, it adds explicit Known Answer Tests (KATs), as the Pairwise Consistency Tests (PCTs) that we were using previously are no longer considered sufficient for CASTs.

Also adds pairwise consistency tests on key import for RSA and DSA, per recent changes in the FIPS 140-3 implementation guidance. ECDSA PCTs continue to be run prior to signing or key export, as a performance optimization. ECDH and DH do not have explicit PCTs, but they include the required checks specified in SP 800-56A rev 3.

Related work items: #53481333
2024-08-30 05:26:38 +00:00
Cagdas Calik 15d0779214 Merged PR 10817310: Add XMSS and XMSS^MT implementations
## Description:

Adds support for stateful hash-based signatures XMSS and XMSS^MT per RFC 8391 and NIST SP800-208.

## Admin Checklist:
- [ ] You have updated documentation in symcrypt.h to reflect any changes in behavior
- [ ] You have updated CHANGELOG.md to reflect any changes in behavior
- [ ] You have updated symcryptunittest to exercise any new functionality
- [ ] If you have introduced any symbols in symcrypt.h you have updated production and test dynamic export symbols (exports.ver / exports.def / symcrypt.src) and tested the updated dynamic modules with symcryptunittest
- [ ] If you have introduced functionality that varies based on CPU features, you have manually tested with and without relevant features
- [ ] If you have made significant changes to a particular algorithm, you have checked that performance numbers reported by symcryptunittest are in line with expectations
- [ ] If you have added new algorithms/modes, you have updated the status indicator text for the associated modules if necessary

Related work items: #52453903
2024-08-13 18:14:13 +00:00
Maxwell Moyer-McKee f89cbf36c3 Merged PR 11087190: SSKDF implementation
## Description:
SSKDF implementation and unit tests.
 
## Admin Checklist:
- [x] You have updated documentation in symcrypt.h to reflect any changes in behavior
- [x] You have updated CHANGELOG.md to reflect any changes in behavior
- [x] You have updated symcryptunittest to exercise any new functionality
- [x] If you have introduced any symbols in symcrypt.h you have updated production and test dynamic export symbols (exports.ver / exports.def / symcrypt.src) and tested the updated dynamic modules with symcryptunittest
- [x] If you have introduced functionality that varies based on CPU features, you have manually tested with and without relevant features
- [X] If you have made significant changes to a particular algorithm, you have checked that performance numbers reported by symcryptunittest are in line with expectations
- [X] If you have added new algorithms/modes, you have updated the status indicator text for the associated modules if necessary

Related work items: #51795170
2024-08-12 22:55:13 +00:00
Samuel Lee fcea477bd6 Merged PR 11162679: Fix DATA annotations on Windows .def files
## Description:

+ Add DATA annotation to data exports in symcrypt.dll .def file, and to a few data exports missed from symcrypttestmodule.dll. This primarily fixes use of Arm64X .dlls when loaded from an emulated AMD64 process.
+ Remove outdated DH comment (today we do input validation when importing DH keys unless the caller explicitly opts out of doing those validations)

Related work items: #50915485
2024-07-26 23:17:23 +00:00
Cagdas Calik fb337b0bec Merged PR 9834558: Add FIPS Status Indicator
## Description:
This PR addresses the FIPS 140-3 requirement for crypto modules to support an approved services status indicator function.
 
## Admin Checklist:
- [X] You have updated documentation in symcrypt.h to reflect any changes in behavior
- [X] You have updated CHANGELOG.md to reflect any changes in behavior
- [X] You have updated symcryptunittest to exercise any new functionality
- [X] If you have introduced any symbols in symcrypt.h you have updated production and test dynamic export symbols (exports.ver / exports.def / symcrypt.src) and tested the updated dynamic modules with symcryptunittest
- [ ] If you have introduced functionality that varies based on CPU features, you have manually tested with and without relevant features
- [ ] If you have made significant changes to a particular algorithm, you have checked that performance numbers reported by symcryptunittest are in line with expectations

Related work items: #47548894
2023-11-13 21:32:26 +00:00
Samuel Lee ffbb5939a3 Merged PR 9759115: Adding support for salt length detection in RSA-PSS verification
Adding support for salt length detection in RSA-PSS verification

+ Add SYMCRYPT_FLAG_RSA_PSS_VERIFY_WITH_MINIMUM_SALT flag to
  SymCryptRsaPssVerify and SymCryptRsaPssVerifySignaturePadding
+ When verifying a PSS signature with this flag specified, allow salt
  length >= the caller specified cbSalt
+ In symcryptunittest, test that verification succeeds and fails w.r.t. the cbSalt
 and flag in the correct way
+ Some small unrelated changes

Related work items: #33692439
2023-10-27 22:46:31 +00:00
Samuel Lee 4425e78d9d Merged PR 9685563: Extend XTS-AES for SCOSSL and SymCrypt FIPS
+ Add SymCryptXtsAes(En|De)cryptEx to induce XTS-AES with 128b tweak
+ Add SymCryptXtsAesExpandKeyEx to do FIPS IG check for non-equal
 halves of XTS key
+ Refactor Multi-DataUnit logic to reduce code duplication using
 new xtsaes_pattern.c file to instantiate the logic with various
 specializations
+ Add support for ciphertext stealing in both old and new API surface,
  allowing data unit sizes which are not a multiple of 16 bytes
+ Add IEEE test vectors for odd data unit sizes
+ Update randomized tests to exercise both 64-bit and 128-bit tweak
  interfaces, and new supported data unit sizes
+ Update XTS tests to allow CNG to fail with unsupported parameters
+ Update XTS FIPS self-test to use FIPS-approved key expansion function
+ Fix a couple of typos found while making changes

Related work items: #43854713
2023-10-19 23:17:23 +00:00
Samuel Lee 00bd38df56 Merged PR 8952367: Export Variables with DATA keyword in SymCryptTestModule.dll
+ This is required to enable AMD64 symcryptunittest.exe running emulated
  on Arm64 to dynamically load Arm64X symcrypttestmodule.dll, as without
  the DATA keyword the variables are exported as functions with an AMD64
  to ARM64EC shim

Related work items: #44587958
2023-05-11 00:54:56 +00:00
Cagdas Calik ef2e54a42d Merged PR 8399946: Add HMAC support for SHA-3
Add HMAC-SHA3-256, HMAC-SHA3-384, HMAC-SHA3-512 implementations.

Other changes:
- Add generic HMAC API
- Introduce a unique state for each of the Keccak based algorithms
- Convert tabs to spaces in symcryptasm files

Related work items: #41559779
2023-01-26 01:04:50 +00:00
Cagdas Calik d026121894 Merged PR 8234403: Add SHA-3 based algorithms: SHAKE, cSHAKE, and KMAC
This PR adds the following algorithm implementations to SymCrypt:
- Extendable-output functions (XOFs)
  - SHAKE128
  - SHAKE256
- Customizable XOFs
  - cSHAKE128
  - cSHAKE256
- Keccak Message Authentication Code (KMAC)
  - KMAC128
  - KMAC256

Related work items: #41559779
2023-01-17 23:54:37 +00:00
Mitch Lindgren 🦎 515bc99971 Merged PR 8235253: Enable OneBranch pipelines
This change rewrites our Azure DevOps pipelines to be compatible with OneBranch pipelines. It also adds new scripts to help with building, testing and packaging SymCrypt. These scripts replicate some of the functionality of `scbuild` but are also compatible with Linux builds. They can be used directly on the command line by developers, but the OneBranch pipeline also uses them to move as much as possible of the "business logic" of building SymCrypt out of the YAML templates and into Python scripts.

Also includes various reorganization and small fixes.
2023-01-12 00:52:49 +00:00
Samuel Lee b8a005237c Merged PR 8152559: Introduce SymCryptKernelTestModule
+ New dynamic module SymCryptKernelTestModule_UM.dll and kernel driver
  SymCryptKernelTestModule.sys which enable unit tests to call into
  driver using the existing SymCrypt dynamic module flow
+ Update a few places in tests which assume objects created by module
  under test can have their internals inspected (which is not the case
  when the object lives in kernel and the unit tests are running in user
  mode)
+ SymCryptKernelTestModule.sys tracks all allocations it makes and ensures it
 frees everything when it is unloaded

Related work items: #38706387
2022-12-16 22:58:09 +00:00
Cagdas Calik 93a82712df Merged PR 7979179: Add SHA-3 implementations
This update adds C implementations of SHA-3-256, SHA-3-384, and SHA-3-512 hash functions per FIPS 202.

Related work items: #41559779
2022-10-25 20:39:41 +00:00
Cagdas Calik bc66c79cde Merged PR 7810991: Add SRTP-KDF and SSH-KDF implementations
- Add SRTP-KDF and SSH-KDF implementations
- Update `SYMCRYPT_HASH` structure to contain hash state copying function member

Related work items: #38101963, #38102026
2022-09-19 20:13:04 +00:00
Samuel Lee ea3b8b1958 Merged PR 7672902: Create and test against simple SymCrypt Windows test module (dll)
+ Builds in both CMake and Razzle, and test in CI pipeline

Related work items: #38706387
2022-08-16 06:55:18 +00:00