pike.git
/
src
/
post_modules
/
Nettle
/
nettle.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/post_modules/Nettle/nettle.cmod:383:
if(missing) { free_object(obj); Pike_error("Object is missing identifier \"%s\"\n", missing); } return obj; } /*! @class CBC
-
*! @belongs Crypto
+
*! Implementation of the cipher block chaining mode (CBC). Works as *! a wrapper for the cipher algorithm put in create.
-
+
*!
+
*! @note
+
*! Use @[Crypto.CBC] instead.
*/ PIKECLASS CBC {
-
+
/*! @decl inherit __builtin.Nettle.Cipher
+
*/
+
INHERIT "__builtin.Nettle.Cipher";
+
CVAR struct object *object; CVAR unsigned INT8 *iv; CVAR INT32 block_size; CVAR INT32 mode; INIT { THIS->object = NULL; THIS->iv = NULL; THIS->block_size = 0;
pike.git/src/post_modules/Nettle/nettle.cmod:625:
pop_n_elems(args); push_string(make_shared_binary_string((INT8 *)result, offset)); guaranteed_memset(result, 0, offset); CALL_AND_UNSET_ONERROR (uwp); } } /*! @endclass */
-
/*! @class
Buffer
-
*! @belongs Crypto
+
/*! @class
Proxy
*! Acts as a buffer so that data can be fed to a cipher in blocks *! that don't correspond to cipher block sizes. *!
-
*!
@example
-
*!
class
Encrypter
-
*! {
-
*! protected
Crypto.Buffer
buffer;
-
*!
-
*! void create(string key)
-
*! {
-
*! buffer = Crypto
.
Buffer(Crypto.CBC(Crypto.AES));
-
*! buffer->set_encrypt_key(key);
-
*! }
-
*!
-
*! string feed(string data)
-
*! {
-
*! return buffer->crypt(data);
-
*! }
-
*!
-
*! string drain()
-
*! {
-
*! return buffer->pad(Crypto.PAD_PKCS7);
-
*! }
-
*! }
+
*!
@note
+
*!
Use
@[
Crypto.Buffer
]
instead
.
*/ PIKECLASS Proxy {
-
+
/*! @decl inherit __builtin.Nettle.Cipher
+
*/
+
INHERIT "__builtin.Nettle.Cipher";
+
CVAR struct object *object; CVAR int block_size; CVAR unsigned char *backlog; CVAR int backlog_len; INIT { THIS->object = NULL; THIS->block_size = 0; THIS->backlog = NULL; THIS->backlog_len = 0;