904 const TypeFunc* OptoRuntime::updateBytesCRC32C_Type() { 905 // create input type (domain) 906 int num_args = 4; 907 int argcnt = num_args; 908 const Type** fields = TypeTuple::fields(argcnt); 909 int argp = TypeFunc::Parms; 910 fields[argp++] = TypeInt::INT; // crc 911 fields[argp++] = TypePtr::NOTNULL; // buf 912 fields[argp++] = TypeInt::INT; // len 913 fields[argp++] = TypePtr::NOTNULL; // table 914 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); 915 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); 916 917 // result type needed 918 fields = TypeTuple::fields(1); 919 fields[TypeFunc::Parms+0] = TypeInt::INT; // crc result 920 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields); 921 return TypeFunc::make(domain, range); 922 } 923 924 // for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning int 925 const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() { 926 // create input type (domain) 927 int num_args = 5; 928 if (Matcher::pass_original_key_for_aes()) { 929 num_args = 6; 930 } 931 int argcnt = num_args; 932 const Type** fields = TypeTuple::fields(argcnt); 933 int argp = TypeFunc::Parms; 934 fields[argp++] = TypePtr::NOTNULL; // src 935 fields[argp++] = TypePtr::NOTNULL; // dest 936 fields[argp++] = TypePtr::NOTNULL; // k array 937 fields[argp++] = TypePtr::NOTNULL; // r array 938 fields[argp++] = TypeInt::INT; // src len 939 if (Matcher::pass_original_key_for_aes()) { 940 fields[argp++] = TypePtr::NOTNULL; // original k array 941 } 942 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); 943 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); | 904 const TypeFunc* OptoRuntime::updateBytesCRC32C_Type() { 905 // create input type (domain) 906 int num_args = 4; 907 int argcnt = num_args; 908 const Type** fields = TypeTuple::fields(argcnt); 909 int argp = TypeFunc::Parms; 910 fields[argp++] = TypeInt::INT; // crc 911 fields[argp++] = TypePtr::NOTNULL; // buf 912 fields[argp++] = TypeInt::INT; // len 913 fields[argp++] = TypePtr::NOTNULL; // table 914 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); 915 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); 916 917 // result type needed 918 fields = TypeTuple::fields(1); 919 fields[TypeFunc::Parms+0] = TypeInt::INT; // crc result 920 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields); 921 return TypeFunc::make(domain, range); 922 } 923 924 /** 925 * int updateBytesAdler32(int adler, bytes* b, int off, int len) 926 */ 927 const TypeFunc* OptoRuntime::updateBytesAdler32_Type() { 928 // create input type (domain) 929 int num_args = 3; 930 int argcnt = num_args; 931 const Type** fields = TypeTuple::fields(argcnt); 932 int argp = TypeFunc::Parms; 933 fields[argp++] = TypeInt::INT; // crc 934 fields[argp++] = TypePtr::NOTNULL; // src + offset 935 fields[argp++] = TypeInt::INT; // len 936 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); 937 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); 938 939 // result type needed 940 fields = TypeTuple::fields(1); 941 fields[TypeFunc::Parms+0] = TypeInt::INT; // crc result 942 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields); 943 return TypeFunc::make(domain, range); 944 } 945 946 // for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning int 947 const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() { 948 // create input type (domain) 949 int num_args = 5; 950 if (Matcher::pass_original_key_for_aes()) { 951 num_args = 6; 952 } 953 int argcnt = num_args; 954 const Type** fields = TypeTuple::fields(argcnt); 955 int argp = TypeFunc::Parms; 956 fields[argp++] = TypePtr::NOTNULL; // src 957 fields[argp++] = TypePtr::NOTNULL; // dest 958 fields[argp++] = TypePtr::NOTNULL; // k array 959 fields[argp++] = TypePtr::NOTNULL; // r array 960 fields[argp++] = TypeInt::INT; // src len 961 if (Matcher::pass_original_key_for_aes()) { 962 fields[argp++] = TypePtr::NOTNULL; // original k array 963 } 964 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); 965 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); |