Skip to content

Commit

Permalink
unify my_{en|de}crypt_{cbc|ecb|ctr}. no yassl support yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Apr 5, 2015
1 parent 27cc252 commit 2f8d101
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 570 deletions.
53 changes: 42 additions & 11 deletions include/my_crypt.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
Copyright (c) 2014 Google Inc.
Copyright (c) 2014, 2015 MariaDB Corporation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

// TODO: Add Windows support

#ifndef MYSYS_MY_CRYPT_H_
Expand All @@ -12,24 +29,38 @@ Crypt_result my_aes_encrypt_ctr(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const unsigned char* key, uint8 key_length,
const unsigned char* iv, uint8 iv_length,
uint noPadding);
uint no_padding);

Crypt_result my_aes_decrypt_ctr(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const unsigned char* key, uint8 key_length,
const unsigned char* iv, uint8 iv_length,
uint noPadding);
C_MODE_END
uint no_padding);

Crypt_result my_aes_encrypt_cbc(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const unsigned char* key, uint8 key_length,
const unsigned char* iv, uint8 iv_length,
uint no_padding);

Crypt_result my_aes_decrypt_cbc(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const unsigned char* key, uint8 key_length,
const unsigned char* iv, uint8 iv_length,
uint no_padding);

Crypt_result EncryptAes128Ctr(const uchar* key,
const uchar* iv, int iv_size,
const uchar* plaintext, int plaintext_size,
uchar* ciphertext, int* ciphertext_used);
Crypt_result my_aes_encrypt_ecb(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const unsigned char* key, uint8 key_length,
const unsigned char* iv, uint8 iv_length,
uint no_padding);

Crypt_result DecryptAes128Ctr(const uchar* key,
const uchar* iv, int iv_size,
const uchar* ciphertext, int ciphertext_size,
uchar* plaintext, int* plaintext_used);
Crypt_result my_aes_decrypt_ecb(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,
const unsigned char* key, uint8 key_length,
const unsigned char* iv, uint8 iv_length,
uint no_padding);
C_MODE_END

#endif /* !defined(HAVE_YASSL) && defined(HAVE_OPENSSL) */

Expand Down
Loading

0 comments on commit 2f8d101

Please sign in to comment.