cbc_crypt functioning

  • Thread starter Bill Cunningham
  • Start date
B

Bill Cunningham

ok. Let me try to start at the beginning and make this as simple as
possible and try to make sense. The first two parameters to cbc_crypt are
char *. And therefore are 8 bytes in size each. Now this 3rd parameter
confuses me. It says multiples of 8 must exist. Parameter 1 and 2 should
each be 8 bytes. How does one make sure that strlen always reports an
unsigned type of a number that is a multiple of 8? Isn't this what this
function is wanting? Is a size_t just and unsigned int?

Bill
 
B

Ben Bacarisse

Bill Cunningham said:
ok. Let me try to start at the beginning and make this as simple as
possible and try to make sense. The first two parameters to cbc_crypt are
char *. And therefore are 8 bytes in size each.

That may be true on your machine, but it might not be true on mine or
someone else's. That said, I am almost certain that you are confusing
the size of the pointer with the size of the thing it points to.

cbc_crypt is not standard C, so there is no way I can know what function
you are talking about. Questions about how to use it are better off in
a group where people will all be talking about the same function. You
probably want comp.unix.programmer.
Now this 3rd parameter
confuses me. It says multiples of 8 must exist. Parameter 1 and 2 should
each be 8 bytes. How does one make sure that strlen always reports an
unsigned type of a number that is a multiple of 8?

This is, in a way, a C question but strlen does not come into it. If a
function says that the data length must be a multiple of 8 all it means
is that it's up to you to ensure that that's true. It just means that
valid arguments are 0, 8, 16, 24... and so on. Of course, you also have
to ensure that there actually are that many bytes available, so your
data array must be at least that many bytes in size (it can be larger of
course).
Isn't this what this
function is wanting? Is a size_t just and unsigned int?

No, size_t is some unsigned integer type, not necessarily unsigned int.
 
B

Bill Cunningham

Ben said:
cbc_crypt is not standard C, so there is no way I can know what
function you are talking about.

http://linux.die.net/man/3/cbc_crypt

Questions about how to use it are
better off in a group where people will all be talking about the same
function. You probably want comp.unix.programmer.

This is, in a way, a C question but strlen does not come into it. If
a function says that the data length must be a multiple of 8 all it
means is that it's up to you to ensure that that's true. It just
means that valid arguments are 0, 8, 16, 24... and so on. Of course,
you also have to ensure that there actually are that many bytes
available, so your data array must be at least that many bytes in
size (it can be larger of course).


No, size_t is some unsigned integer type, not necessarily unsigned
int.

I don't know what you mean by the above types comment.

Bill
 
B

Barry Schwarz

snip

We are being trolled. Bill has already changed the topic twice. He
started with iterating functions, then claimed he didn't understand
the difference between if and for, and now this gibberish. And just
for good measure, he started at least two new threads with different
subjects.

I never should have responded to the first one.
 
B

Ben Bacarisse

[You've snipped my attribution lines so I can't show that the question
was originally yours. I try to keep attributions for all text I quote.]
Ben Bacarisse wrote:

(actually Bill, not me)
I don't know what you mean by the above types comment.

Which bit is causing trouble? "unsigned int" is one of a whole range of
unsigned integer types in C (unsigned long long int, unsigned char,
unsigned short int and so on). size_t is some unsigned integer type but
not necessarily unsigned int. It might, for example, be unsigned long
int.
 
B

Ben Bacarisse

Barry Schwarz said:
snip

We are being trolled.

Maybe. Maybe not. I avoid having to decide by replying if I can see
some value in the content of my reply, rather than in the questioner's
motivation.

My message said (a) don't confuse the size of a pointer with the size of
the thing it points to; (b) go to comp.unix.programmer to find out more
about how to use cbc_crypt; and (c) it clarified a point about size_t.
That all tipped the balance into it being worth replying no matter who
asked. I long ago stopped expecting Bill to derive any benefit from my
posts.

<snip>
 
B

Bill Cunningham

Ben said:
[You've snipped my attribution lines so I can't show that the question
was originally yours. I try to keep attributions for all text I
quote.]

Sorry.
 
B

Bill Cunningham

Ben said:
Maybe. Maybe not. I avoid having to decide by replying if I can see
some value in the content of my reply, rather than in the questioner's
motivation.
[snip]

I began a thread about iterating and wasn't thinking about exactly what
I wanted and chopped up the post. I was there interested in a function
written in ansi or iso C that would check a number for multiples of 8. A
factor tree of sorts. A function that taking a number like 16 would factor
out 2 8s. This would be passed somehow to the OT cbc_crypt function's
parameter. I was getting ahead of myself. I guess it's not done like that.
You have to manually set the multiples of 8 youself.

Bill
 
B

Bill Cunningham

Ben said:
Which bit is causing trouble? "unsigned int" is one of a whole range
of unsigned integer types in C (unsigned long long int, unsigned char,
unsigned short int and so on). size_t is some unsigned integer type
but not necessarily unsigned int. It might, for example, be unsigned
long int.

unsigned char is an int? I thought there were several types but they
weren't all ints. Signed and unsignedness I know.
shorts longs and long longs I can understand as ints but I've never thought
of a char being an int.

Bill
 
J

jacob navia

Le 03/05/12 19:35, Barry Schwarz a écrit :
snip

We are being trolled. Bill has already changed the topic twice. He
started with iterating functions, then claimed he didn't understand
the difference between if and for, and now this gibberish. And just
for good measure, he started at least two new threads with different
subjects.

I never should have responded to the first one.

It is easy to stop cunningham.

I wrote to his first thread "sort of an iterating function":


Your state of mind, as reflected by your prose, is utter confusion.
You imply in your posts that somehow your medication is responsible but
that is not the problem. The problem is that you assume that the other
people are responsible for your nonsense and that you do not have to
make the effort of RE-READING what you write 2 or 3 times to ensure
that the grammar is correct and that anyone can understand what you
write.

For instance you could have written "bcrypt" instead of ?_bcrypt
as you wrote. A simple re-reading would have fixed that. But you do
not make any effort at all to re-read what you write. Just post it.
The others should make the necessary effort.

That is a LAZY attitude that leads you to NOTHING. You have never made
ANY progress, either in C or in English in the last 8+ years
that you have been posting nonsense here. Before learning C you
should try to write a single post WITHOUT any error of grammar.

Make an effort Cunningham. Stop pitying yourself.

jacob

Then he started a new thread.
 
B

Ben Bacarisse

Bill Cunningham said:
unsigned char is an int?

No, and I don't think I said it was. "int" is a C type. "integer" is
an English word that describes a property shared by may C types.
unsigned char is an integer type. One of many integer types in C.
I thought there were several types but they
weren't all ints. Signed and unsignedness I know.
shorts longs and long longs I can understand as ints but I've never thought
of a char being an int.

None of them are "ints", all of them are integer types.
 
K

Kaz Kylheku

It is easy to stop cunningham.

For something easy, it sure is taking a lot of years with no evidence of
progress. :)

There is a new word for the Cunninghams out there: "help vampire".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top