File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
csharp/ql/lib/experimental/quantum/dotnet Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -84,13 +84,14 @@ private class RSAClass extends Type {
8484 RSAClass ( ) { this .hasFullyQualifiedName ( "System.Security.Cryptography" , "RSA" ) }
8585}
8686
87- // TODO
88- // class ByteArrayTypeUnionReadOnlyByteSpan extends ArrayType {
89- // ByteArrayTypeUnionReadOnlyByteSpan() {
90- // this.hasFullyQualifiedName("System", "Byte[]") or
91- // this.hasFullyQualifiedName("System", "ReadOnlySpan`1") or
92- // }
93- // }
87+ class ByteArrayType extends Type {
88+ ByteArrayType ( ) { this .getName ( ) = "Byte[]" }
89+ }
90+
91+ class ReadOnlyByteSpanType extends Type {
92+ ReadOnlyByteSpanType ( ) { this .getName ( ) = "ReadOnlySpan<Byte>" }
93+ }
94+
9495abstract class DotNetSigner extends MethodCall {
9596 DotNetSigner ( ) { this .getTarget ( ) .getName ( ) .matches ( [ "Verify%" , "Sign%" ] ) }
9697
@@ -102,8 +103,13 @@ abstract class DotNetSigner extends MethodCall {
102103
103104 Expr getSignatureArg ( ) {
104105 this .isVerifier ( ) and
105- // TODO: Should replace getAChild* with the proper two types byte[] and ReadOnlySpan<byte>
106- ( result = this .getArgument ( [ 1 , 3 ] ) and result .getType ( ) .getAChild * ( ) instanceof ByteType )
106+ (
107+ result = this .getArgument ( [ 1 , 3 ] ) and
108+ (
109+ result .getType ( ) instanceof ByteArrayType or
110+ result .getType ( ) instanceof ReadOnlyByteSpanType
111+ )
112+ )
107113 }
108114
109115 Expr getSignatureOutput ( ) {
You can’t perform that action at this time.
0 commit comments