All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.provider.padding.OneAndZeroes

java.lang.Object
   |
   +----java.security.IJCE_Traceable
           |
           +----java.security.PaddingScheme
                   |
                   +----cryptix.provider.padding.OneAndZeroes

public final class OneAndZeroes
extends PaddingScheme
Class for padding cipher data with a binary-digit one, followed by as many binary-digit zeroes as needed to fill this instance's blockSize.

Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.3 $

Author:
Raif S. Naffah
See Also:
PaddingScheme

Constructor Index

 o OneAndZeroes()
Creates a OneAndZeroes object.

Method Index

 o engineIsValidBlockSize(int)
SPI: Returns true if size is a valid block size (in bytes) for this algorithm.
 o enginePad(byte[], int, int)
Pads a given array of bytes.
 o engineUnpad(byte[], int, int)
Given the specified subarray of bytes that includes padding bytes, returns the index indicating where padding starts.

Constructors

 o OneAndZeroes
 public OneAndZeroes()
Creates a OneAndZeroes object.

Methods

 o enginePad
 protected int enginePad(byte in[],
                         int offset,
                         int length)
Pads a given array of bytes. The padding is written to the same buffer that is used for input (in). When this method returns, the padded block will be stored at in[offset..offset+blockSize-1].

Parameters:
in - the buffer containing the incomplete block.
offset - the offset into the in buffer of the first byte in the group of bytes to be padded.
length - the number of bytes from the in buffer, starting at offset, that need to be padded.
Overrides:
enginePad in class PaddingScheme
 o engineUnpad
 protected int engineUnpad(byte in[],
                           int offset,
                           int length)
Given the specified subarray of bytes that includes padding bytes, returns the index indicating where padding starts.

Parameters:
in - the buffer containing the bytes.
offset - the offset into the in buffer of the first byte in the block.
length - the number of bytes from the in buffer to check, starting at offset.
Returns:
the index into the in buffer indicating where the padding starts.
Overrides:
engineUnpad in class PaddingScheme
 o engineIsValidBlockSize
 protected boolean engineIsValidBlockSize(int size)
SPI: Returns true if size is a valid block size (in bytes) for this algorithm.

For OneAndZeroes padding, all sizes are valid.

Overrides:
engineIsValidBlockSize in class PaddingScheme

All Packages  Class Hierarchy  This Package  Previous  Next  Index