1
0
mirror of https://github.com/biergaizi/codecrypt synced 2024-06-27 09:18:16 +00:00
Commit Graph

7 Commits

Author SHA1 Message Date
Tom Li
7021f6c734
sc.h: correct access violation in load_key_vector(), close #2.
In load_key_vector(), the program passes a std::vector<byte> to
a C-style function, load_key (const byte*begin, const byte*end)
by creating references

    load_key (& (K[0]), & (K[K.size()]));

However, accessing the one-past-the-last element in a std::vector
via [] is not allowed in C++, it triggers an assertion failure.

    Assertion '__builtin_expect(__n < this->size(), true)' failed.

In this commit, we use K.data() and K.data() + K.size() to expose
the underlying pointers and pass them to the C function.

Signed-off-by: Tom Li <tomli@tomli.me>
2019-01-02 11:42:04 +08:00
Mirek Kratochvil
a09344f034 add proper copyright notices 2016-04-17 15:48:09 +02:00
Mirek Kratochvil
19d59f9ec1 bulk-apply new code styling rules 2015-10-31 22:58:17 +01:00
Mirek Kratochvil
9c4287c636 named collections for hashes and stream ciphers
also, with the funny factoryof<> and instanceof<> primitives that kindof
solve the memory trouble.
2014-04-05 23:45:01 +02:00
Mirek Kratochvil
fd489ae69f generator: remove rc4 usage, some cleaning 2014-04-05 11:36:50 +02:00
Mirek Kratochvil
6a8029e626 cosmetic fixes 2014-03-28 08:33:44 +01:00
Mirek Kratochvil
e687629323 sc: stream cipher abstraction applied to arcfour
A minor bug was discovered in padding of short message signatures. If is
silently fixed, causing some (very minor) incompatibility of signatures
with previous versions.
2014-03-19 09:30:59 +01:00