Main Page Modules Data Structures File List Data Fields Globals Related Pages

# beecrypt/blockpad.c File Reference

Blockcipher padding, code. More...

`#include "system.h"`
`#include "blockpad.h"`
`#include "debug.h"`

Go to the source code of this file.

## Functions
memchunk * | pkcs5Pad (int blockbytes, memchunk *tmp)
| Enlarge buffer to boundary. More...
memchunk * | pkcs5Unpad (int blockbytes, memchunk *tmp)
| Shrink buffer to boundary. More...
memchunk * | pkcs5PadCopy (int blockbytes, const memchunk *src)
| Copy/enlarge buffer to boundary. More...
memchunk * | pkcs5UnpadCopy (int blockbytes, const memchunk *src)
| Copy/shrink buffer to boundary. More...

## Detailed Description

Blockcipher padding, code.

Definition in file blockpad.c.

## Function Documentation

memchunk* pkcs5Pad | ( | int | blockbytes,
|  | memchunk * | tmp
| ) |

  | Enlarge buffer to boundary. Parameters:
  blockbytes | desired block alignment/pad boundary
  tmp | buffer to pad
Returns: buffer with pad added Definition at line 33 of file blockpad.c. References memchunk::data, memchunkResize, and memchunk::size.

memchunk* pkcs5PadCopy | ( | int | blockbytes,
|  | const memchunk * | src
| ) |

  | Copy/enlarge buffer to boundary. Parameters:
  blockbytes | desired block alignment/pad boundary
  src | buffer to pad
Returns: copy of buffer with pad added Definition at line 80 of file blockpad.c. References memchunk::data, memchunkAlloc, and memchunk::size.

memchunk* pkcs5Unpad | ( | int | blockbytes,
|  | memchunk * | tmp
| ) |

  | Shrink buffer to boundary. Parameters:
  blockbytes | desired block alignment/pad boundary
  tmp | buffer to unpad
Returns: buffer with pad removed Definition at line 50 of file blockpad.c. References memchunk::data, and memchunk::size.

memchunk* pkcs5UnpadCopy | ( | int | blockbytes,
|  | const memchunk * | src
| ) |

  | Copy/shrink buffer to boundary. Parameters:
  blockbytes | desired block alignment/pad boundary
  src | buffer to unpad
Returns: copy of buffer with pad removed Definition at line 101 of file blockpad.c. References memchunk::data, memchunkAlloc, and memchunk::size.