Package list libcryptx-perl / befdfb1
Revert "ISO 10126 padding - related to #54" This reverts commit 6a66eaa40ab684a06856383ac7e70a7d7ad06bb4. Karel Miko 2 years ago
6 changed file(s) with 0 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
119119 # 3 ANSI X.923 padding
120120 # 4 zero padding
121121 # 5 zero padding (+a block of zeros if the output length is divisible by the blocksize)
122 # 6 ISO 10126 padding
123122 # $cipher_rounds ... optional num of rounds for given cipher
124123 [%-ELSE%]
125124 my $m = Crypt::Mode::[%orig_name%]->new($name);
235235 else if (self->padding_mode == 3) { padmode = LTC_PAD_ANSI_X923 | (&self->state)->blocklen; }
236236 else if (self->padding_mode == 4) { padmode = LTC_PAD_ZERO | (&self->state)->blocklen; }
237237 else if (self->padding_mode == 5) { padmode = LTC_PAD_ZERO_ALWAYS | (&self->state)->blocklen; }
238 else if (self->padding_mode == 6) { padmode = LTC_PAD_ISO_10126 | (&self->state)->blocklen; }
239238 else { croak("FATAL: unknown padding"); }
240239 blen = sizeof(self->pad);
241240 rv = padding_pad(self->pad, self->padlen, &blen, padmode);
259258 else if (self->padding_mode == 3) { padmode = LTC_PAD_ANSI_X923 | (&self->state)->blocklen; }
260259 else if (self->padding_mode == 4) { padmode = LTC_PAD_ZERO | (&self->state)->blocklen; }
261260 else if (self->padding_mode == 5) { padmode = LTC_PAD_ZERO_ALWAYS | (&self->state)->blocklen; }
262 else if (self->padding_mode == 6) { padmode = LTC_PAD_ISO_10126 | (&self->state)->blocklen; }
263261 else { croak("FATAL: unknown padding"); }
264262 rv = padding_depad(tmp_block, &blen, padmode);
265263 if (rv != CRYPT_OK) croak("FATAL: padding_depad failed: %s", error_to_string(rv));
223223 else if (self->padding_mode == 3) { padmode = LTC_PAD_ANSI_X923 | (&self->state)->blocklen; }
224224 else if (self->padding_mode == 4) { padmode = LTC_PAD_ZERO | (&self->state)->blocklen; }
225225 else if (self->padding_mode == 5) { padmode = LTC_PAD_ZERO_ALWAYS | (&self->state)->blocklen; }
226 else if (self->padding_mode == 6) { padmode = LTC_PAD_ISO_10126 | (&self->state)->blocklen; }
227226 else { croak("FATAL: unknown padding"); }
228227 blen = sizeof(self->pad);
229228 rv = padding_pad(self->pad, self->padlen, &blen, padmode);
247246 else if (self->padding_mode == 3) { padmode = LTC_PAD_ANSI_X923 | (&self->state)->blocklen; }
248247 else if (self->padding_mode == 4) { padmode = LTC_PAD_ZERO | (&self->state)->blocklen; }
249248 else if (self->padding_mode == 5) { padmode = LTC_PAD_ZERO_ALWAYS | (&self->state)->blocklen; }
250 else if (self->padding_mode == 6) { padmode = LTC_PAD_ISO_10126 | (&self->state)->blocklen; }
251249 else { croak("FATAL: unknown padding"); }
252250 rv = padding_depad(tmp_block, &blen, padmode);
253251 if (rv != CRYPT_OK) croak("FATAL: padding_depad failed: %s", error_to_string(rv));
216216 else if (self->padding_mode == 3) { padmode = LTC_PAD_ANSI_X923 | (&self->state)->blocklen; }
217217 else if (self->padding_mode == 4) { padmode = LTC_PAD_ZERO | (&self->state)->blocklen; }
218218 else if (self->padding_mode == 5) { padmode = LTC_PAD_ZERO_ALWAYS | (&self->state)->blocklen; }
219 else if (self->padding_mode == 6) { padmode = LTC_PAD_ISO_10126 | (&self->state)->blocklen; }
220219 else { croak("FATAL: unknown padding"); }
221220 blen = sizeof(self->pad);
222221 rv = padding_pad(self->pad, self->padlen, &blen, padmode);
240239 else if (self->padding_mode == 3) { padmode = LTC_PAD_ANSI_X923 | (&self->state)->blocklen; }
241240 else if (self->padding_mode == 4) { padmode = LTC_PAD_ZERO | (&self->state)->blocklen; }
242241 else if (self->padding_mode == 5) { padmode = LTC_PAD_ZERO_ALWAYS | (&self->state)->blocklen; }
243 else if (self->padding_mode == 6) { padmode = LTC_PAD_ISO_10126 | (&self->state)->blocklen; }
244242 else { croak("FATAL: unknown padding"); }
245243 rv = padding_depad(tmp_block, &blen, padmode);
246244 if (rv != CRYPT_OK) croak("FATAL: padding_depad failed: %s", error_to_string(rv));
7575 # 3 ANSI X.923 padding
7676 # 4 zero padding
7777 # 5 zero padding (+a block of zeros if the output length is divisible by the blocksize)
78 # 6 ISO 10126 padding
7978 # $cipher_rounds ... optional num of rounds for given cipher
8079
8180 =head2 encrypt
7676 # 3 ANSI X.923 padding
7777 # 4 zero padding
7878 # 5 zero padding (+a block of zeros if the output length is divisible by the blocksize)
79 # 6 ISO 10126 padding
8079 # $cipher_rounds ... optional num of rounds for given cipher
8180
8281 =head2 encrypt