Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void cbc_mode_test() {
- int i;
- uint32_t key[] = {0x7e7a9cb4, 0x89a201f3, 0x14d6fed4, 0xbe21afea};
- uint32_t text[] = { 0x9e4587e3, 0xe49383a2,
- 0xe1432902, 0xbe790210,
- 0xa39ffe11, 0x93333276,
- 0x21247348, 0x85956106,
- 0x169f5ea6, 0xdb8a7137 };
- uint32_t iv[] = { 0x74f78c88, 0x8d8844a1 };
- text[0] = iv[0] ^ text[0];
- text[1] = iv[1] ^ text[1];
- printf("(CBC) plaintext = ");
- for(int i = 0; i< 10 ; i++)
- {
- ciphertext[i] = encrypt(text[i] ^ ciphertext[i]-1,key[0]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement