diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
commit | 02d7aa8915f9c3a3288dab01f321eb94ba219e3b (patch) | |
tree | f053238978479e408a2b83571443e132f30586ab /src/libsec/port/des.c | |
parent | c0c9d8f883dfd3a7f5a74499d91bb95884b15873 (diff) | |
parent | 3d1382b98a502d0c34d5ba2c462396acc515016e (diff) | |
download | plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.gz plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.bz2 plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/libsec/port/des.c')
-rw-r--r-- | src/libsec/port/des.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/libsec/port/des.c b/src/libsec/port/des.c index c54541c5..f14d2ea9 100644 --- a/src/libsec/port/des.c +++ b/src/libsec/port/des.c @@ -133,7 +133,7 @@ block_cipher(ulong key[32], uchar text[8], int decrypting) ^ fetch(5, v1, 8) ^ fetch(7, v1, 0); key += keystep; - + v0 = key[0]; v0 ^= (left >> 1) | (left << 31); right ^= fetch(0, v0, 24) @@ -229,7 +229,7 @@ triple_block_cipher(ulong expanded_key[3][32], uchar text[8], int ende) ^ fetch(5, v1, 8) ^ fetch(7, v1, 0); key += keystep; - + v0 = key[0]; v0 ^= (left >> 1) | (left << 31); right ^= fetch(0, v0, 24) @@ -409,21 +409,21 @@ des_key_setup(uchar key[8], ulong *ek) static uchar parity[128] = { - 0x01, 0x02, 0x04, 0x07, 0x08, 0x0b, 0x0d, 0x0e, - 0x10, 0x13, 0x15, 0x16, 0x19, 0x1a, 0x1c, 0x1f, - 0x20, 0x23, 0x25, 0x26, 0x29, 0x2a, 0x2c, 0x2f, - 0x31, 0x32, 0x34, 0x37, 0x38, 0x3b, 0x3d, 0x3e, - 0x40, 0x43, 0x45, 0x46, 0x49, 0x4a, 0x4c, 0x4f, - 0x51, 0x52, 0x54, 0x57, 0x58, 0x5b, 0x5d, 0x5e, - 0x61, 0x62, 0x64, 0x67, 0x68, 0x6b, 0x6d, 0x6e, - 0x70, 0x73, 0x75, 0x76, 0x79, 0x7a, 0x7c, 0x7f, - 0x80, 0x83, 0x85, 0x86, 0x89, 0x8a, 0x8c, 0x8f, - 0x91, 0x92, 0x94, 0x97, 0x98, 0x9b, 0x9d, 0x9e, - 0xa1, 0xa2, 0xa4, 0xa7, 0xa8, 0xab, 0xad, 0xae, - 0xb0, 0xb3, 0xb5, 0xb6, 0xb9, 0xba, 0xbc, 0xbf, - 0xc1, 0xc2, 0xc4, 0xc7, 0xc8, 0xcb, 0xcd, 0xce, - 0xd0, 0xd3, 0xd5, 0xd6, 0xd9, 0xda, 0xdc, 0xdf, - 0xe0, 0xe3, 0xe5, 0xe6, 0xe9, 0xea, 0xec, 0xef, + 0x01, 0x02, 0x04, 0x07, 0x08, 0x0b, 0x0d, 0x0e, + 0x10, 0x13, 0x15, 0x16, 0x19, 0x1a, 0x1c, 0x1f, + 0x20, 0x23, 0x25, 0x26, 0x29, 0x2a, 0x2c, 0x2f, + 0x31, 0x32, 0x34, 0x37, 0x38, 0x3b, 0x3d, 0x3e, + 0x40, 0x43, 0x45, 0x46, 0x49, 0x4a, 0x4c, 0x4f, + 0x51, 0x52, 0x54, 0x57, 0x58, 0x5b, 0x5d, 0x5e, + 0x61, 0x62, 0x64, 0x67, 0x68, 0x6b, 0x6d, 0x6e, + 0x70, 0x73, 0x75, 0x76, 0x79, 0x7a, 0x7c, 0x7f, + 0x80, 0x83, 0x85, 0x86, 0x89, 0x8a, 0x8c, 0x8f, + 0x91, 0x92, 0x94, 0x97, 0x98, 0x9b, 0x9d, 0x9e, + 0xa1, 0xa2, 0xa4, 0xa7, 0xa8, 0xab, 0xad, 0xae, + 0xb0, 0xb3, 0xb5, 0xb6, 0xb9, 0xba, 0xbc, 0xbf, + 0xc1, 0xc2, 0xc4, 0xc7, 0xc8, 0xcb, 0xcd, 0xce, + 0xd0, 0xd3, 0xd5, 0xd6, 0xd9, 0xda, 0xdc, 0xdf, + 0xe0, 0xe3, 0xe5, 0xe6, 0xe9, 0xea, 0xec, 0xef, 0xf1, 0xf2, 0xf4, 0xf7, 0xf8, 0xfb, 0xfd, 0xfe, }; @@ -476,5 +476,5 @@ key_setup(uchar key[7], ulong *ek) uchar k64[8]; des56to64(key, k64); - des_key_setup(k64, ek); + des_key_setup(k64, ek); } |