2 Copyright (C) 2008, The Perl Foundation.
7 src/dynpmc/@md_file@.pmc - @md_name@ wrapper of libcrypto (libssl)
11 See L<www.openssl.org>
21 #include <openssl/@md_inc@.h>
37 @md_ctx@ *c = mem_allocate_zeroed_typed(@md_ctx@);
39 PObj_active_destroy_SET(SELF);
41 real_exception(interp, NULL, ILL_INHERIT, "@md_name@ is disabled");
47 =item C<void destroy()>
54 @md_ctx@ *c = PMC_data_typed(SELF, @md_ctx@ *);
57 PMC_data(SELF) = NULL;
71 PMC *retval = pmc_new_noinit(INTERP, SELF->vtable->base_type);
72 @md_ctx@ *c = mem_allocate_zeroed_typed(@md_ctx@);
74 memcpy(c, PMC_data(SELF), sizeof (@md_ctx@));
77 PObj_active_destroy_SET(retval);
89 =head2 Specific Methods
100 @md_ctx@ *c = PMC_data_typed(SELF, @md_ctx@ *);
101 (void)@md_name@_Init(c);
107 =item C<void Update(STRING *buf)>
112 METHOD void Update(STRING *buf) {
114 @md_ctx@ *c = PMC_data_typed(SELF, @md_ctx@ *);
115 (void)@md_name@_Update(c, (unsigned char *)buf->strstart, buf->bufused);
121 =item C<STRING* Final()>
126 METHOD STRING* Final() {
128 unsigned char digest[@md_digest@_LENGTH];
129 @md_ctx@ *c = PMC_data_typed(SELF, @md_ctx@ *);
132 (void)@md_name@_Final(digest, c);
133 retval = string_from_cstring(INTERP, (char *)digest, @md_digest@_LENGTH);
135 RETURN(STRING *retval);
157 * c-file-style: "parrot"
159 * vim: expandtab shiftwidth=4: