Home | History | Annotate | Download | only in demos

Lines Matching refs:kl

160    int err, kl, lastkl;
177 case 0: kl = cipher_descriptor[x].min_key_length; break;
178 case 1: kl = (cipher_descriptor[x].min_key_length + cipher_descriptor[x].max_key_length)/2; break;
179 case 2: kl = cipher_descriptor[x].max_key_length; break;
181 if ((err = cipher_descriptor[x].keysize(&kl)) != CRYPT_OK) {
185 if (kl == lastkl) break;
186 lastkl = kl;
187 fprintf(out, "Key Size: %d bytes\n", kl);
189 key = XMALLOC(kl);
195 for (z = 0; (int)z < kl; z++) {
198 if ((err = cipher_descriptor[x].setup(key, kl, 0, &skey)) != CRYPT_OK) {
215 for (z = 0; z < (unsigned long)kl; z++) {
218 if ((err = cipher_descriptor[x].setup(key, kl, 0, &skey)) != CRYPT_OK) {
286 int err, x, y, z, kl;
298 kl = cipher_descriptor[x].block_length;
301 if (kl != 8 && kl != 16) continue;
303 if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
304 kl = cipher_descriptor[x].max_key_length;
306 fprintf(out, "OMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
309 for (y = 0; y < kl; y++) {
318 if ((err = omac_memory(x, key, kl, input, y, output, &len)) != CRYPT_OK) {
329 for (z = 0; z < kl; z++) {
341 int err, x, y, z, kl;
353 kl = cipher_descriptor[x].block_length;
356 if (kl != 8 && kl != 16) continue;
358 if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
359 kl = cipher_descriptor[x].max_key_length;
361 fprintf(out, "PMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
364 for (y = 0; y < kl; y++) {
373 if ((err = pmac_memory(x, key, kl, input, y, output, &len)) != CRYPT_OK) {
384 for (z = 0; z < kl; z++) {
395 int err, kl, x, y1, z;
407 kl = cipher_descriptor[x].block_length;
410 if (kl != 8 && kl != 16) continue;
412 if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
413 kl = cipher_descriptor[x].max_key_length;
415 fprintf(out, "EAX-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
418 for (z = 0; z < kl; z++) {
429 if ((err = eax_encrypt_authenticate_memory(x, key, kl, nonce, y1, header, y1, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) {
444 for (z = 0; z < kl; z++) {
455 int err, kl, x, y1, z;
467 kl = cipher_descriptor[x].block_length;
470 if (kl != 8 && kl != 16) continue;
472 if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
473 kl = cipher_descriptor[x].max_key_length;
475 fprintf(out, "OCB-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
478 for (z = 0; z < kl; z++) {
492 if ((err = ocb_encrypt_authenticate_memory(x, key, kl, nonce, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) {
507 for (z = 0; z < kl; z++) {
519 int err, kl, x, y1, z;
531 kl = cipher_descriptor[x].block_length;
534 if (kl != 16) continue;
536 if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
537 kl = cipher_descriptor[x].max_key_length;
539 fprintf(out, "CCM-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
542 for (z = 0; z < kl; z++) {
556 if ((err = ccm_memory(x, key, kl, NULL, nonce, 13, plaintext, y1, plaintext, y1, plaintext, tag, &len, CCM_ENCRYPT)) != CRYPT_OK) {
571 for (z = 0; z < kl; z++) {
582 int err, kl, x, y1, z;
593 kl = cipher_descriptor[x].block_length;
596 if (kl != 16) continue;
598 if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
599 kl = cipher_descriptor[x].max_key_length;
601 fprintf(out, "GCM-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
604 for (z = 0; z < kl; z++) {
613 if ((err = gcm_memory(x, key, kl, plaintext, y1, plaintext, y1, plaintext, y1, plaintext, tag, &len, GCM_ENCRYPT)) != CRYPT_OK) {
628 for (z = 0; z < kl; z++) {