CUBRID Engine  latest
crypt_opfunc.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /*
20  * Crypt_opfunc.h:
21  */
22 
23 #ifndef _CRYPT_OPFUNC_H_
24 #define _CRYPT_OPFUNC_H_
25 
26 #ident "$Id$"
27 
28 #include "thread_compat.hpp"
29 
30 typedef enum
31 {
35 
36 typedef enum
37 {
41 
42 extern int crypt_default_encrypt (THREAD_ENTRY * thread_p, const char *src, int src_len, const char *key,
43  int key_len, char **dest_p, int *dest_len_p, CIPHER_ENCRYPTION_TYPE enc_type);
44 extern int crypt_default_decrypt (THREAD_ENTRY * thread_p, const char *src, int src_len, const char *key,
45  int key_len, char **dest_p, int *dest_len_p, CIPHER_ENCRYPTION_TYPE enc_type);
46 extern int crypt_sha_one (THREAD_ENTRY * thread_p, const char *src, int src_len, char **dest_p, int *dest_len_p);
47 extern int crypt_sha_two (THREAD_ENTRY * thread_p, const char *src, int src_len, int need_hash_len, char **dest_p,
48  int *dest_len_p);
49 extern int crypt_md5_buffer_hex (const char *buffer, size_t len, char *resblock);
50 extern char *str_to_hex (THREAD_ENTRY * thread_p, const char *src, int src_len, char **dest_p, int *dest_len_p,
51  HEX_LETTERCASE lettercase);
52 extern void str_to_hex_prealloced (const char *src, int src_len, char *dest, int dest_len, HEX_LETTERCASE lettercase);
53 
54 extern int crypt_generate_random_bytes (char *dest, int length);
55 extern void crypt_crc32 (const char *src, int src_len, int *dest);
56 
57 #endif
int crypt_sha_two(THREAD_ENTRY *thread_p, const char *src, int src_len, int need_hash_len, char **dest_p, int *dest_len_p)
Definition: crypt_opfunc.c:490
int crypt_sha_one(THREAD_ENTRY *thread_p, const char *src, int src_len, char **dest_p, int *dest_len_p)
Definition: crypt_opfunc.c:473
int crypt_default_encrypt(THREAD_ENTRY *thread_p, const char *src, int src_len, const char *key, int key_len, char **dest_p, int *dest_len_p, CIPHER_ENCRYPTION_TYPE enc_type)
Definition: crypt_opfunc.c:212
HEX_LETTERCASE
Definition: crypt_opfunc.h:30
void str_to_hex_prealloced(const char *src, int src_len, char *dest, int dest_len, HEX_LETTERCASE lettercase)
Definition: crypt_opfunc.c:103
void THREAD_ENTRY
int crypt_md5_buffer_hex(const char *buffer, size_t len, char *resblock)
Definition: crypt_opfunc.c:646
CIPHER_ENCRYPTION_TYPE
Definition: crypt_opfunc.h:36
int crypt_generate_random_bytes(char *dest, int length)
Definition: crypt_opfunc.c:688
void crypt_crc32(const char *src, int src_len, int *dest)
Definition: crypt_opfunc.c:672
char * str_to_hex(THREAD_ENTRY *thread_p, const char *src, int src_len, char **dest_p, int *dest_len_p, HEX_LETTERCASE lettercase)
Definition: crypt_opfunc.c:141
int crypt_default_decrypt(THREAD_ENTRY *thread_p, const char *src, int src_len, const char *key, int key_len, char **dest_p, int *dest_len_p, CIPHER_ENCRYPTION_TYPE enc_type)
Definition: crypt_opfunc.c:334