X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/57dbb7df8973a3e0c0c570c1eae9d84802e02bd9..59b7476481f01388fcfd13492adbba7ef841755c:/src/clave_fija.cpp?ds=inline diff --git a/src/clave_fija.cpp b/src/clave_fija.cpp index ebb08ea..71f6f0d 100644 --- a/src/clave_fija.cpp +++ b/src/clave_fija.cpp @@ -2,26 +2,29 @@ #include #include "clave_fija.h" -ClaveFija::ClaveFija (int n) +ClaveFija::ClaveFija (int n, uint bd) { data = n; + block_data = bd; } ClaveFija::ClaveFija (uchar *n) { memcpy (&data, n, sizeof(int)); + memcpy (&block_data, n+sizeof(int), sizeof(int)); } uint ClaveFija::Size () const { - return sizeof (int); + return sizeof (int)+sizeof(uint); } uchar *ClaveFija::ToArray () const { uchar *out; - out = new uchar[sizeof(int)]; + out = new uchar[Size ()]; memcpy (out, &data, sizeof(int)); + memcpy (out+sizeof (int), &block_data, sizeof(int)); return out; }