exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

valid.c

valid.c
Posted Dec 21, 1999

valid.c

tags | encryption
SHA-256 | 5f74aaae1f3bbd096635fa8061ea093524cc3bce7fbf254b72cdcf20ae325b17

valid.c

Change Mirror Download
#include <stdio.h>
#include <string.h>

#include "square.h"

static void squarePrint (const byte *block, const char *tag)
{
printf ("%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x %s\n",
block[ 0], block[ 1], block[ 2], block[ 3],
block[ 4], block[ 5], block[ 6], block[ 7],
block[ 8], block[ 9], block[10], block[11],
block[12], block[13], block[14], block[15],
tag);
} /* squarePrint */


int main (void)
{
int i;
squareBlock key, block;
squareKeySchedule roundKeys_e;

printf ("===========================================================================\n\n"
"Validation data set for Square v1.0\n\n");

printf ("===========================================================================\n\n"
"Encryption of the null data block with every key where a single bit is set:\n\n");
memset (block, 0, SQUARE_BLOCKSIZE);
squarePrint (block, "plaintext\n");
for (i = 0; i < 128; i++) {
memset (key, 0, SQUARE_BLOCKSIZE);
key[i/8] |= 1 << (7 - i%8); /* set only the i-th bit of the i-th test key */
squarePrint (key, "key");
memset (block, 0, SQUARE_BLOCKSIZE);
squareExpandKey (key, roundKeys_e);
squareEncrypt ((word32 *)block, roundKeys_e);
squarePrint (block, "ciphertext\n\n");
}

printf ("===========================================================================\n\n"
"Encryption of a sample data block with every key where a single bit is set:\n\n");
memcpy (block, "\x0f\x1e\x2d\x3c\x4b\x5a\x69\x78\x87\x96\xa5\xb4\xc3\xd2\xe1\xf0", SQUARE_BLOCKSIZE);
squarePrint (block, "plaintext\n");
for (i = 0; i < 128; i++) {
memset (key, 0, SQUARE_BLOCKSIZE);
key[i/8] |= 1 << (7 - i%8); /* set only the i-th bit of the i-th test key */
squarePrint (key, "key");
memcpy (block, "\x0f\x1e\x2d\x3c\x4b\x5a\x69\x78\x87\x96\xa5\xb4\xc3\xd2\xe1\xf0", SQUARE_BLOCKSIZE);
squareExpandKey (key, roundKeys_e);
squareEncrypt ((word32 *)block, roundKeys_e);
squarePrint (block, "ciphertext\n\n");
}

printf ("===========================================================================\n\n");

return 0;
}
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close