31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CryptByteString<br />

s(uint16 idx start, uint16 idx end)<br />

returns the substring s[idx start], . . . , s[idx end].<br />

CryptByteString s.hash(uint16 num iterations = 1)<br />

computes a hash of s, num iterations specifies<br />

how often the hash function is applied.<br />

string s.to hex string( ) computes a hexadecimal reprasentation of s, each<br />

byte is represented by two hex-digits.<br />

string s.to string( ) converts s into a string.<br />

CryptByteString<br />

CryptByteString<br />

CryptByteString<br />

void<br />

const CryptByteString& x + const CryptByteString& y<br />

returns the concatenation of x and y.<br />

CryptByteString :: from hex string(const char ∗ hex str)<br />

creates a CryptByteString from a string of hexdigits.<br />

CryptByteString :: from string(const char ∗ str)<br />

converts the string str into a CryptByteString.<br />

CryptByteString :: wipe memory(void ∗ mem, uint32 sz)<br />

wipes out sz bytes starting at the address given<br />

by mem.<br />

10.2 Key for Cryptography ( CryptKey )<br />

1. Definition<br />

Instances of the class CryptKey store keys for cryptographic algorithms. CryptKey is<br />

derived from CryptByteString and hence, its instances also wipe out their memory upon<br />

destruction. Apart from the operations of its base class CryptKey provides some static<br />

operations which can be helpful for key generation.<br />

#include < <strong>LEDA</strong>/coding/crypt key.h ><br />

2. Creation<br />

CryptKey k;<br />

creates an empty key.<br />

CryptKey k(uint16 size);<br />

creates a key of the given size. All bytes in k are set to zero.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!