1 /*
2 * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
812 // for aescrypt encrypt/decrypt operations, just three pointers returning void (length is constant)
813 const TypeFunc* OptoRuntime::aescrypt_block_Type() {
814 // create input type (domain)
815 int num_args = 3;
816 int argcnt = num_args;
817 const Type** fields = TypeTuple::fields(argcnt);
818 int argp = TypeFunc::Parms;
819 fields[argp++] = TypePtr::NOTNULL; // src
820 fields[argp++] = TypePtr::NOTNULL; // dest
821 fields[argp++] = TypePtr::NOTNULL; // k array
822 assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
823 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
824
825 // no result type needed
826 fields = TypeTuple::fields(1);
827 fields[TypeFunc::Parms+0] = NULL; // void
828 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields);
829 return TypeFunc::make(domain, range);
830 }
831
832 // for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning void
833 const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() {
834 // create input type (domain)
835 int num_args = 5;
836 int argcnt = num_args;
837 const Type** fields = TypeTuple::fields(argcnt);
838 int argp = TypeFunc::Parms;
839 fields[argp++] = TypePtr::NOTNULL; // src
840 fields[argp++] = TypePtr::NOTNULL; // dest
841 fields[argp++] = TypePtr::NOTNULL; // k array
842 fields[argp++] = TypePtr::NOTNULL; // r array
843 fields[argp++] = TypeInt::INT; // src len
844 assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
845 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
846
847 // no result type needed
848 fields = TypeTuple::fields(1);
849 fields[TypeFunc::Parms+0] = NULL; // void
850 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields);
851 return TypeFunc::make(domain, range);
|
1 /*
2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
812 // for aescrypt encrypt/decrypt operations, just three pointers returning void (length is constant)
813 const TypeFunc* OptoRuntime::aescrypt_block_Type() {
814 // create input type (domain)
815 int num_args = 3;
816 int argcnt = num_args;
817 const Type** fields = TypeTuple::fields(argcnt);
818 int argp = TypeFunc::Parms;
819 fields[argp++] = TypePtr::NOTNULL; // src
820 fields[argp++] = TypePtr::NOTNULL; // dest
821 fields[argp++] = TypePtr::NOTNULL; // k array
822 assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
823 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
824
825 // no result type needed
826 fields = TypeTuple::fields(1);
827 fields[TypeFunc::Parms+0] = NULL; // void
828 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields);
829 return TypeFunc::make(domain, range);
830 }
831
832 /**
833 * int updateBytesCRC32(int crc, byte* b, int len)
834 */
835 const TypeFunc* OptoRuntime::updateBytesCRC32_Type() {
836 // create input type (domain)
837 int num_args = 3;
838 int argcnt = num_args;
839 const Type** fields = TypeTuple::fields(argcnt);
840 int argp = TypeFunc::Parms;
841 fields[argp++] = TypeInt::INT; // crc
842 fields[argp++] = TypePtr::NOTNULL; // src
843 fields[argp++] = TypeInt::INT; // len
844 assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
845 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
846
847 // result type needed
848 fields = TypeTuple::fields(1);
849 fields[TypeFunc::Parms+0] = TypeInt::INT; // crc result
850 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields);
851 return TypeFunc::make(domain, range);
852 }
853
854 // for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning void
855 const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() {
856 // create input type (domain)
857 int num_args = 5;
858 int argcnt = num_args;
859 const Type** fields = TypeTuple::fields(argcnt);
860 int argp = TypeFunc::Parms;
861 fields[argp++] = TypePtr::NOTNULL; // src
862 fields[argp++] = TypePtr::NOTNULL; // dest
863 fields[argp++] = TypePtr::NOTNULL; // k array
864 fields[argp++] = TypePtr::NOTNULL; // r array
865 fields[argp++] = TypeInt::INT; // src len
866 assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
867 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
868
869 // no result type needed
870 fields = TypeTuple::fields(1);
871 fields[TypeFunc::Parms+0] = NULL; // void
872 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields);
873 return TypeFunc::make(domain, range);
|