ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Crypt-Twofish2/Twofish2.xs
(Generate patch)

Comparing Crypt-Twofish2/Twofish2.xs (file contents):
Revision 1.1 by root, Sat Sep 6 22:10:54 2003 UTC vs.
Revision 1.2 by root, Wed Jul 14 15:55:44 2004 UTC

23 23
24PROTOTYPES: ENABLE 24PROTOTYPES: ENABLE
25 25
26BOOT: 26BOOT:
27{ 27{
28 HV * stash = gv_stashpv ("Crypt::Twofish2", 0); 28 HV *stash = gv_stashpv ("Crypt::Twofish2", 0);
29 29
30 newCONSTSUB (stash, "keysize", newSViv (32)); 30 newCONSTSUB (stash, "keysize", newSViv (32));
31 newCONSTSUB (stash, "blocksize", newSViv (16)); 31 newCONSTSUB (stash, "blocksize", newSViv (16));
32 newCONSTSUB (stash, "MODE_ECB", newSViv (MODE_ECB)); 32 newCONSTSUB (stash, "MODE_ECB", newSViv (MODE_ECB));
33 newCONSTSUB (stash, "MODE_CBC", newSViv (MODE_CBC)); 33 newCONSTSUB (stash, "MODE_CBC", newSViv (MODE_CBC));
80 if (size % (BLOCK_SIZE >> 3)) 80 if (size % (BLOCK_SIZE >> 3))
81 croak ("encrypt: datasize not multiple of blocksize (%d bits)", BLOCK_SIZE); 81 croak ("encrypt: datasize not multiple of blocksize (%d bits)", BLOCK_SIZE);
82 82
83 RETVAL = NEWSV (0, size); 83 RETVAL = NEWSV (0, size);
84 SvPOK_only (RETVAL); 84 SvPOK_only (RETVAL);
85 (SvPVX (RETVAL))[size] = 0;
85 SvCUR_set (RETVAL, size); 86 SvCUR_set (RETVAL, size);
86 87
87 if ((ix ? blockDecrypt : blockEncrypt) 88 if ((ix ? blockDecrypt : blockEncrypt)
88 (&self->ci, &self->ki, rawbytes, size << 3, (void *)SvPV_nolen(RETVAL)) < 0) 89 (&self->ci, &self->ki, rawbytes, size << 3, (void *)SvPV_nolen(RETVAL)) < 0)
89 croak ("block(De|En)crypt: unknown error, please report"); 90 croak ("block(De|En)crypt: unknown error, please report");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines