Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nettle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marcus Hoffmann
nettle
Commits
18eaed2f
Commit
18eaed2f
authored
Sep 09, 2001
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
Rev: src/nettle/ChangeLog:1.17 Rev: src/nettle/cbc.c:1.3
parent
df4ba6cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
6 deletions
+46
-6
ChangeLog
ChangeLog
+20
-0
cbc.c
cbc.c
+26
-6
No files found.
ChangeLog
View file @
18eaed2f
2001-09-09 Niels Mller <nisse@cuckoo.hack.org>
* Makefile.am (libnettleinclude_HEADERS): Added cbc.h. Deleted
des3.h.
(libnettle_a_SOURCES): Added des3.c.
* testsuite/Makefile.am (TS_PROGS): Added des3-test and cbc-test.
* testsuite/cbc-test.m4: New testcase.
* testsuite/des3-test.m4: New testcase.
* cbc.h (CBC_CTX): New macro.
(CBC_ENCRYPT): New macro.
(CBC_DECRYPT): New macro.
* des.c (des_fix_parity): New function.
* des3.c: New file, implementing triple des.
2001-09-06 Niels Mller <nisse@cuckoo.hack.org>
* cbc.c, cbc.h: New files, for general CBC encryption.
...
...
cbc.c
View file @
18eaed2f
...
...
@@ -81,13 +81,33 @@ cbc_decrypt(void *ctx, void (*f)(void *ctx,
memcpy
(
iv
,
src
+
length
-
block_size
,
block_size
);
}
#include "des.h"
#if 0
#include "twofish.h"
#include "aes.h"
static void foo(void)
{
struct
des_ctx
ctx
;
uint8_t
iv
[
DES_BLOCK_SIZE
];
uint8_t
src
[
DES_BLOCK_SIZE
];
uint8_t
dst
[
DES_BLOCK_SIZE
];
struct CBC_CTX(struct twofish_ctx, TWOFISH_BLOCK_SIZE) ctx;
uint8_t src[TWOFISH_BLOCK_SIZE];
uint8_t dst[TWOFISH_BLOCK_SIZE];
CBC_ENCRYPT(&ctx, twofish_encrypt, TWOFISH_BLOCK_SIZE, dst, src);
/* Should result in a warning */
CBC_ENCRYPT(&ctx, aes_encrypt, TWOFISH_BLOCK_SIZE, dst, src);
}
static void foo2(void)
{
struct twofish_ctx ctx;
uint8_t iv[TWOFISH_BLOCK_SIZE];
uint8_t src[TWOFISH_BLOCK_SIZE];
uint8_t dst[TWOFISH_BLOCK_SIZE];
CBC_ENCRYPT
(
&
ctx
,
des_encrypt
,
DES_BLOCK_SIZE
,
iv
,
DES_BLOCK_SIZE
,
dst
,
src
);
CBC_ENCRYPT2(&ctx, twofish_encrypt, TWOFISH_BLOCK_SIZE, iv, TWOFISH_BLOCK_SIZE, dst, src);
/* Should result in a warning */
CBC_ENCRYPT2(&ctx, aes_encrypt, TWOFISH_BLOCK_SIZE, iv, TWOFISH_BLOCK_SIZE, dst, src);
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment