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

20 Коммитов

Автор SHA1 Сообщение Дата
Samuel Lee 2b82f03465 Merged PR 11375621: Fix outstanding Prefast warnings
+ Fixing various Prefast warnings to get us clean w.r.t. Prefast
  + Enable Prefast failures to break PR builds
+ Reduce noisy build warnings
+ Unpin Windows container images as using old images

Related work items: #52514550, #52514551, #52514554, #52514555, #52514556, #52514557, #52514559, #52514560, #52514561, #52514562, #52514632, #52514633, #52514634, #53004108, #53004109, #53130817
2024-09-05 23:26:39 +00:00
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
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
Changyu Li 60abd9e61c Merged PR 10540579: Add OpenSSL implementation for RSA PSS test
## Description:

## 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
2024-04-12 00:00:10 +00:00
Changyu Li b893aa9d20 Merged PR 10406838: Add OpenSSL implementation for XtsAes test
## Description:

We add OpenSSL as submodule to 3rdparty and link symcryptunittest to it so we can compare the SymCrypt implementation. We add perf and functional test for XtsAes as well.

## 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: #49347468
2024-03-16 00:10:00 +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
Mitch Lindgren 🦎 6fca352c3e Merged PR 8797661: Add MSBuild solution and project files for SymCrypt
This pull request adds MSBuild solution and project files so that SymCrypt can be built using the undocked OneBranch pipeline, including the kernel mode components. See the SymCrypt EO Compliance document for more information on why this is being done, and the high-level overview of how it will be accomplished.

In addition to adding the MSBuild files, I removed a bunch of files that were no longer being used, such as the iOS workspace and project files, old kernel test drivers that are not used in the RI-TP, etc.

Related work items: #42154697
2023-05-23 08:11:33 +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
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 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 d1d4572f31 Merged PR 7594329: Enable SymCrypt unit tests to drive a dynamic module
+ Just targeting Linux modules for now as we do not yet have a Windows SymCrypt module
+ At the command line when running symcryptunittest add option to load and test a dynamic SymCrypt module from a path
+ Enable a shim layer in our test code calling SymCrypt functions, and based on the template specialization or a global variable (depending upon the context of the function being called), the shim directs the function call to different places
+ Rework the multi-implementation part of the code handling SymCrypt's implementation (sc_imp*) to enable multiple SymCrypt implementations to coexist
  + The pre-existing ImpSc's shim is augmented to always add vector register save/restore testing around every call into the statically linked SymCrypt function. All previous test calls for vector register testing are removed. We may add other tests here in future (i.e. checking the contents of the stack are clean on SymCrypt function return?).
  + The new ImpScStatic implementation directly calls the statically linked SymCrypt function. This is used in performance tests
  + The new ImpScDynamic implementation uses a static variable in a lambda function to store dynamic symbol pointers that are looked up (once per lambda function) at runtime using dlsym. These pointers are then used to test the dynamic module directly (i.e. without any unit-test specific environment). This enables both comparative functional testing with static and dynamic SymCrypt, and realistic performance testing of the dynamic SymCrypt module
+ Also tests directly calling the SymCrypt APIs (not all tests calling low-level SymCrypt APIs) to shim to static or dynamic versions

Related work items: #38706387
2022-08-05 20:01:21 +00:00
Samuel Lee 62b3f1dcd9 Fix SymCryptDlkeySizeofPrivateKey & add further tests 2021-11-30 10:03:24 -08:00
Samuel Lee 0e232d4392 Merged PR 6315721: OACR fixups
+ Resolves all issues flagged by runoacr in symcrypt\lib
  + Leaves some oacr issues in test code
+ Also includes some unrelated fixes to typos etc.

Related work items: #35052770
2021-08-04 15:18:36 +00:00
Samuel Lee 2829fe90fb Merged PR 5689743: Changes for SP800-56arev3 FIPS 140-2 compliance
+ Add validation flags for DlKey and EcKey Import and Generate
  + Enables callers to perform the correct amount of validation to be compliant with SP800-56arev3
+ Add support for named safe-prime groups in DH, as shortest path to supporting compliance using FFC
  + This will enable BCrypt callers to explicitly or implicitly use named safe-prime groups groups and have the requisite validation, rather than having to create a new in-memory representation of DH keys to expose the prime Q
  + Add tests to for validity of the named safe-prime group constants, so the unit tests should pick up on inadvertent changes, or errors in definitions of new safe-prime groups if/when they may be added
+ Enable the strictest validation that makes sense in all existing tests to exercise validation code.
  + Also randomly exercise the use of all the different valid flag combinations in tests

Related work items: #26526301, #26527152, #31528841, #31528936, #31529044, #31782556
2021-02-20 00:08:55 +00:00
Samuel Lee 8d4e109955 Merged PR 5607908: Introduce mode to output cycle measurements for different DataSizes
+ A bit hacky but sharing for visibility on how I generated https://microsofteur-my.sharepoint.com//g/personal/saml_microsoft_com1/ERC3CXr-PzZIk7tSOGxURawBVu7D5NZQASnAqSZSWFUGlw?e=gzy790
+ Easy to import into excel with comma delimited values, and make a
  pivot table for analysis
+ Add some usage text to give an idea of how to use the new mode
2021-01-26 14:21:04 +00:00
Niels Ferguson f2e14c27d3 Merged PR 4025062: New tests for DS and DSA
New tests for DH and DSA

Related work items: #15886191
2019-11-15 23:50:15 +00:00
Niels Ferguson f87701444b Merged PR 3919453: Modularize RSA tests
First stage of modularizing the test code. I wrote new test code for RSA signing and RSA encryption.
Added conditional compilation switches to remove the various implementations (RSA32, CNG, CAPI, Bignum, …)
Old test code is still around, some in files called "old-*" and some commented out. We can remove it once we are happy with the new tests.
Fixed one bug found by the new tests.

Related work items: #15886191
2019-10-24 01:49:21 +00:00
Niels Ferguson 092de3fd9a Merged PR 3136947: Fix copyright messages to refer to the MIT license
Fix copyright messages to refer to the MIT license

Related work items: #20681107
2019-04-11 22:52:13 +00:00
Niels Ferguson f020f6aa44 First draft of Symcrypt build system on Git 2018-11-16 16:28:12 -08:00