Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API Proposal]: Arm64: FEAT_SM4 #98696

Open
a74nh opened this issue Feb 20, 2024 · 4 comments
Open

[API Proposal]: Arm64: FEAT_SM4 #98696

a74nh opened this issue Feb 20, 2024 · 4 comments
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation arch-arm64 area-System.Runtime.Intrinsics
Milestone

Comments

@a74nh
Copy link
Contributor

a74nh commented Feb 20, 2024

namespace System.Runtime.Intrinsics.Arm;

/// VectorT Summary
public abstract partial class Sm4 : AdvSimd /// Feature: FEAT_SM4
{

  public static unsafe Vector128<uint> Sm4EncryptionAndDecryption(Vector128<uint> a, Vector128<uint> b); // SM4E

  public static unsafe Vector128<uint> Sm4KeyUpdates(Vector128<uint> a, Vector128<uint> b); // SM4EKEY

  /// total method signatures: 2

}
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 20, 2024
@ghost
Copy link

ghost commented Feb 20, 2024

Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
See info in area-owners.md if you want to be subscribed.

Issue Details
namespace System.Runtime.Intrinsics.Arm;

/// VectorT Summary
public abstract partial class Sm4 : AdvSimd /// Feature: FEAT_SM4
{

  public static unsafe Vector128<uint> Sm4EncryptionAndDecryption(Vector128<uint> a, Vector128<uint> b); // SM4E

  public static unsafe Vector128<uint> Sm4KeyUpdates(Vector128<uint> a, Vector128<uint> b); // SM4EKEY

  /// total method signatures: 2

}
Author: a74nh
Assignees: -
Labels:

area-System.Runtime.Intrinsics

Milestone: -

@a74nh
Copy link
Contributor Author

a74nh commented Feb 20, 2024

/// Full API
public abstract partial class Sm4 : AdvSimd /// Feature: FEAT_SM4
{
    /// Sm4EncryptionAndDecryption : SM4 Encode takes input data as a 128-bit vector from the first source SIMD&FP register, and four iterations of the round key held as the elements of the 128-bit vector in the second source SIMD&FP register. It encrypts the data by four rounds, in accordance with the SM4 standard, returning the 128-bit result to the destination SIMD&FP register.

    /// uint32x4_t vsm4eq_u32(uint32x4_t a, uint32x4_t b) : "SM4E Vd.4S,Vn.4S"
  public static unsafe Vector128<uint> Sm4EncryptionAndDecryption(Vector128<uint> a, Vector128<uint> b);


    /// Sm4KeyUpdates : SM4 Key takes an input as a 128-bit vector from the first source SIMD&FP register and a 128-bit constant from the second SIMD&FP register. It derives four iterations of the output key, in accordance with the SM4 standard, returning the 128-bit result to the destination SIMD&FP register.

    /// uint32x4_t vsm4ekeyq_u32(uint32x4_t a, uint32x4_t b) : "SM4EKEY Vd.4S,Vn.4S,Vm.4S"
  public static unsafe Vector128<uint> Sm4KeyUpdates(Vector128<uint> a, Vector128<uint> b);


  /// total method signatures: 2
  /// total method names:      2
}


  /// Total ACLE covered across API:      2

@a74nh
Copy link
Contributor Author

a74nh commented Feb 20, 2024

This adds the API for FEAT_SM4. It complements the FEAT_SVE_SM4 API which is specified in #94426.

Note this is a NEON (AdvSimd) extension. It is not a SVE extension.

@a74nh
Copy link
Contributor Author

a74nh commented Feb 20, 2024

@tannergooding : Also As requested, the API for SM4. Identical to the SVE version except for VectorT vs Vector128

@tannergooding tannergooding added api-ready-for-review API is ready for review, it is NOT ready for implementation and removed untriaged New issue has not been triaged by the area owner labels Feb 20, 2024
@stephentoub stephentoub added this to the Future milestone Jul 19, 2024
@tannergooding tannergooding added api-suggestion Early API idea and discussion, it is NOT ready for implementation and removed api-ready-for-review API is ready for review, it is NOT ready for implementation labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation arch-arm64 area-System.Runtime.Intrinsics
Projects
None yet
Development

No branches or pull requests

4 participants