gnu.crypto.pad

Class TLS1

public class TLS1 extends BasePad

The padding scheme used by the Transport Layer Security protocol, version 1. This padding scheme is used in the block-ciphered struct, e.g.:
 block-ciphered struct {
   opaque content[TLSCompressed.length];
   opaque MAC[CipherSpec.hash_size];
   uint8 padding[GenericBlockCipher.padding_length];
   uint8 padding_length;
 } GenericBlockCipher;
 

Where padding_length is any multiple of cipher_block_size - ((SSLCompressed.length + CipherSpec.hash_size) % cipher_block_size) - 1 that is less than 255. Every byte of the padding must be equal to padding_length. That is, the end of the plaintext is n + 1 copies of the unsigned byte n.

Constructor Summary
TLS1()
Method Summary
byte[]pad(byte[] in, int off, int len)
voidsetup()
intunpad(byte[] in, int off, int len)

Constructor Detail

TLS1

public TLS1()

Method Detail

pad

public byte[] pad(byte[] in, int off, int len)

setup

public void setup()

unpad

public int unpad(byte[] in, int off, int len)
Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.