cbc_crypt functioning

Discussion in 'C Programming' started by Bill Cunningham, May 3, 2012.

  1. 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
    Bill Cunningham, May 3, 2012
    #1
    1. Advertising

  2. "Bill Cunningham" <> writes:

    > 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.

    --
    Ben.
    Ben Bacarisse, May 3, 2012
    #2
    1. Advertising

  3. Ben Bacarisse wrote:

    > 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.


    >> 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.


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

    Bill
    Bill Cunningham, May 3, 2012
    #3
  4. On Thu, 03 May 2012 13:04:17 +0100, Ben Bacarisse
    <> wrote:

    >"Bill Cunningham" <> writes:
    >

    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.

    --
    Remove del for email
    Barry Schwarz, May 3, 2012
    #4
  5. Bill Cunningham

    osmium Guest

    "Bill Cunningham" wrote:

    > Ben Bacarisse wrote:
    >
    >> 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


    C is a programming language.

    Linux is an operating system.

    They are different things. There is very likely a Usenet group for Linux;
    try to find one.
    osmium, May 3, 2012
    #5
  6. "Bill Cunningham" <> writes:

    [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)
    >>> 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.

    >
    > 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.

    --
    Ben.
    Ben Bacarisse, May 3, 2012
    #6
  7. Barry Schwarz <> writes:

    > On Thu, 03 May 2012 13:04:17 +0100, Ben Bacarisse
    > <> wrote:
    >
    >>"Bill Cunningham" <> writes:
    >>

    > 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>
    --
    Ben.
    Ben Bacarisse, May 3, 2012
    #7
  8. Ben Bacarisse wrote:
    > "Bill Cunningham" <> writes:
    >
    > [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.
    Bill Cunningham, May 3, 2012
    #8
  9. Ben Bacarisse wrote:
    > Barry Schwarz <> writes:
    >
    >> On Thu, 03 May 2012 13:04:17 +0100, Ben Bacarisse
    >> <> wrote:
    >>
    >>> "Bill Cunningham" <> writes:
    >>>

    >> 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.

    [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
    Bill Cunningham, May 3, 2012
    #9
  10. Ben Bacarisse wrote:

    > 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
    Bill Cunningham, May 3, 2012
    #10
  11. Bill Cunningham

    jacob navia Guest

    Le 03/05/12 19:35, Barry Schwarz a écrit :
    > On Thu, 03 May 2012 13:04:17 +0100, Ben Bacarisse
    > <> wrote:
    >
    >> "Bill Cunningham"<> writes:
    >>

    > 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.
    jacob navia, May 3, 2012
    #11
  12. "Bill Cunningham" <> writes:

    > Ben Bacarisse wrote:
    >
    >> 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?


    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.

    --
    Ben.
    Ben Bacarisse, May 3, 2012
    #12
  13. Bill Cunningham

    Kaz Kylheku Guest

    On 2012-05-03, jacob navia <> wrote:
    > 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".
    Kaz Kylheku, May 3, 2012
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sadf
    Replies:
    4
    Views:
    810
    Bob Carsto
    Nov 14, 2003
  2. =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=

    Enable property of a Panel not functioning

    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=, Feb 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    353
    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=
    Feb 7, 2005
  3. surveyor04
    Replies:
    0
    Views:
    374
    surveyor04
    Feb 12, 2005
  4. Neo Geshel
    Replies:
    5
    Views:
    850
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Jun 14, 2005
  5. =?Utf-8?B?Q2hyeXNhbg==?=

    Comboxbox's SelectedIndexChanged event not functioning

    =?Utf-8?B?Q2hyeXNhbg==?=, Sep 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    427
    =?Utf-8?B?Q2hyeXNhbg==?=
    Sep 29, 2005
Loading...

Share This Page