diff options
author | lloyd <[email protected]> | 2010-09-30 13:31:28 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-30 13:31:28 +0000 |
commit | d45c828067598fc44eff08333c23af413ab2a455 (patch) | |
tree | fe99086a89257f6378049dcdf0848a6a7d5b822b | |
parent | 9e0aa0dca7a4fbfcd9204ba24e678108202569d2 (diff) |
s/x.ptr()/&x[0]/
-rw-r--r-- | doc/old_tutorial.tex | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/old_tutorial.tex b/doc/old_tutorial.tex index ee3bc936b..f220d765a 100644 --- a/doc/old_tutorial.tex +++ b/doc/old_tutorial.tex @@ -231,7 +231,7 @@ same key; that is very much a no-no. // now read the MAC from message #2. Message numbers start from 0 SecureVector<byte> hmac = pipe.read_all(1); - outfile.write((const char*)hmac.ptr(), hmac.size()); + outfile.write((const char*)&hmac[0], hmac.size()); \end{verbatim} The receiver can check the size of the file (in bytes), and since it knows how @@ -302,14 +302,14 @@ made: ) ); - outfile.write((const char*)the_salt.ptr(), the_salt.size()); + outfile.write((const char*)&the_salt[0], the_salt.size()); pipe.start_msg(); infile >> pipe; pipe.end_msg(); SecureVector<byte> hmac = pipe.read_all(1); - outfile.write((const char*)hmac.ptr(), hmac.size()); + outfile.write((const char*)&hmac[0], hmac.size()); \end{verbatim} \subsubsection{Another buffering technique} @@ -324,7 +324,7 @@ that memory pressure is reduced in the case of large inputs. SecureBuffer<byte, 1024> buffer; while(infile.good()) { - infile.read((char*)buffer.ptr(), buffer.size()); + infile.read((char*)&buffer[0], buffer.size()); u32bit got_from_infile = infile.gcount(); pipe.write(buffer, got_from_infile); @@ -334,7 +334,7 @@ that memory pressure is reduced in the case of large inputs. while(pipe.remaining() > 0) { u32bit buffered = pipe.read(buffer, buffer.size()); - outfile.write((const char*)buffer.ptr(), buffered); + outfile.write((const char*)&buffer[0], buffered); } } if(infile.bad() || (infile.fail() && !infile.eof())) |