LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-21-2011, 09:07 AM   #1
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 321
Blog Entries: 1

Rep: Reputation: 31
C++ and CryptoPP: "byte" type?


I'm working in a program which use symmetric encryption (AES algor.) using CryptoPP library. Is my first time using CriptoPP and cryptography in general.

While reading library's documentation and wiki examples I found a "byte" type is used:

Code:
#include <iostream>
#include <iomanip>

#include <cryptopp/aes.h>
#include <cryptopp/modes.h>
#include <cryptopp/osrng.h>
#include <cryptopp/filters.h>
using namespace std;
using namespace CryptoPP;

int main(int argc, char* argv[]) {

    //
    // Key and IV setup
    //
    byte key[ CryptoPP::AES::DEFAULT_KEYLENGTH ], iv[ CryptoPP::AES::BLOCKSIZE ];

      // Generate a random IV
      CryptoPP::AutoSeededRandomPool rnd;
      rnd.GenerateBlock(iv, AES::BLOCKSIZE);
      rnd.GenerateBlock(key, AES::DEFAULT_KEYLENGTH);

// ...
//...
My doubts:

This byte type is a C++ standard or is part of CryptoPP?

Could I use unsigned char type instead of byte?

Really I didn't find this answers in CryptoPP wiki/doc.

Thanks in advance,
Matías
 
Old 01-21-2011, 10:48 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
They're identical:
http://www.cryptopp.com/docs/ref/config_8h_source.html, line 100
 
Old 01-23-2011, 12:07 PM   #3
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 321
Blog Entries: 1

Original Poster
Rep: Reputation: 31
Thanks a lot for your answer Snark1994. It's clear for me now.

Regards,
Matías
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] When I type "sudo grub" it says "command not found" in Ubuntu 9.10 Live CD. msbstar Linux - Newbie 9 07-17-2017 12:27 PM
When I type "sudo grub" it says "command not found" in Ubuntu 10.10 poumtatalia Linux - Newbie 5 09-14-2010 05:21 PM
getting "parameter has incomplete type" and "conflicting types" error yogi.aash Linux - Newbie 2 05-31-2010 06:25 PM
How to get the "data type" of an "unknown variable" in "C Language" ? Affair Programming 8 06-20-2009 12:30 PM
<input type="button" disabled="true" > does not work in ns4.7 or 4.9 cybercop12us Programming 2 11-29-2002 08:31 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration