Skip to content

Commit

Permalink
Merge branch 'main' into feature/minipal_is_native_debugger_present
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 authored Oct 15, 2024
2 parents 6c207e6 + 1464076 commit e66447e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/design/datacontracts/ExecutionManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Suppose there is code starting at address 304 (0x130)

* Then the map index will be 304 / 32 = 9 and the byte offset will be 304 % 32 = 16
* Because addresses are 4-byte aligned, the nibble value will be 1 + 16 / 4 = 5 (we reserve 0 to mean no method).
* So the map unit containing index 9 will contain the value 0x5 << 24 (the map index 9 means we want the second nibble in the second map unit, and we number the nibbles starting from the most significant) , or
* So the map unit containing index 9 will contain the value 0x5 << 24 (the map index 9 means we want the second nibble in the second map unit, and we number the nibbles starting from the most significant) , or
0x05000000


Expand Down
13 changes: 4 additions & 9 deletions src/libraries/System.Private.CoreLib/src/System/Boolean.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,17 @@ public bool TryFormat(Span<char> destination, out int charsWritten)
{
if (m_value)
{
if (destination.Length > 3)
if (TrueLiteral.TryCopyTo(destination))
{
ulong true_val = BitConverter.IsLittleEndian ? 0x65007500720054ul : 0x54007200750065ul; // "True"
MemoryMarshal.Write(MemoryMarshal.AsBytes(destination), in true_val);
charsWritten = 4;
charsWritten = TrueLiteral.Length;
return true;
}
}
else
{
if (destination.Length > 4)
if (FalseLiteral.TryCopyTo(destination))
{
ulong fals_val = BitConverter.IsLittleEndian ? 0x73006C00610046ul : 0x460061006C0073ul; // "Fals"
MemoryMarshal.Write(MemoryMarshal.AsBytes(destination), in fals_val);
destination[4] = 'e';
charsWritten = 5;
charsWritten = FalseLiteral.Length;
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@

#include <assert.h>

c_static_assert(PAL_OperationEncrypt == kCCEncrypt);
c_static_assert(PAL_OperationDecrypt == kCCDecrypt);
c_static_assert((uint32_t)PAL_OperationEncrypt == (uint32_t)kCCEncrypt);
c_static_assert((uint32_t)PAL_OperationDecrypt == (uint32_t)kCCDecrypt);

c_static_assert(PAL_AlgorithmAES == kCCAlgorithmAES128);
c_static_assert(PAL_AlgorithmDES == kCCAlgorithmDES);
c_static_assert(PAL_Algorithm3DES == kCCAlgorithm3DES);
c_static_assert(PAL_AlgorithmRC2 == kCCAlgorithmRC2);
c_static_assert((uint32_t)PAL_AlgorithmAES == (uint32_t)kCCAlgorithmAES128);
c_static_assert((uint32_t)PAL_AlgorithmDES == (uint32_t)kCCAlgorithmDES);
c_static_assert((uint32_t)PAL_Algorithm3DES == (uint32_t)kCCAlgorithm3DES);
c_static_assert((uint32_t)PAL_AlgorithmRC2 == (uint32_t)kCCAlgorithmRC2);

c_static_assert(PAL_ChainingModeECB == kCCModeECB);
c_static_assert(PAL_ChainingModeCBC == kCCModeCBC);
c_static_assert(PAL_ChainingModeCFB == kCCModeCFB);
c_static_assert(PAL_ChainingModeCFB8 == kCCModeCFB8);
c_static_assert((uint32_t)PAL_ChainingModeECB == (uint32_t)kCCModeECB);
c_static_assert((uint32_t)PAL_ChainingModeCBC == (uint32_t)kCCModeCBC);
c_static_assert((uint32_t)PAL_ChainingModeCFB == (uint32_t)kCCModeCFB);
c_static_assert((uint32_t)PAL_ChainingModeCFB8 == (uint32_t)kCCModeCFB8);

c_static_assert(PAL_PaddingModeNone == ccNoPadding);
c_static_assert(PAL_PaddingModePkcs7 == ccPKCS7Padding);
c_static_assert((uint32_t)PAL_PaddingModeNone == (uint32_t)ccNoPadding);
c_static_assert((uint32_t)PAL_PaddingModePkcs7 == (uint32_t)ccPKCS7Padding);

// No PAL_SymmetricOptions are currently mapped, so no asserts required.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ int32_t AppleCryptoNative_X509GetRawData(SecCertificateRef cert, CFDataRef* ppDa
}

*ppDataOut = SecCertificateCopyData(cert);
*pOSStatus = *ppDataOut == NULL ? errSecParam : noErr;
*pOSStatus = *ppDataOut == NULL ? errSecParam : (OSStatus)noErr;
return (*pOSStatus == noErr);
}

Expand Down

0 comments on commit e66447e

Please sign in to comment.