File: himd_private.h

package info (click to toggle)
linux-minidisc 0.9.16-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,640 kB
  • sloc: ansic: 6,389; cpp: 2,731; python: 2,537; perl: 866; sh: 207; makefile: 10
file content (33 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
static inline unsigned int beword16(const unsigned char * c)
{
    return c[0]*256+c[1];
}

static inline unsigned int beword32(const unsigned char * c)
{
    return c[0]*16777216+c[1]*65536+c[2]*256+c[3];
}


static inline void setbeword16(unsigned char * c, unsigned int val)
{
    c[0] = val >> 8;
    c[1] = val & 0xFF;
}

static inline void setbeword32(unsigned char * c, unsigned int val)
{
    c[0] = (val >> 24) & 0xFF;
    c[1] = (val >> 16) & 0xFF;
    c[2] = (val >> 8)  & 0xFF;
    c[3] =  val        & 0xFF;
}

void set_status_const(struct himderrinfo * status, enum himdstatus code, const char * msg);
void set_status_printf(struct himderrinfo * status, enum himdstatus code, const char * format, ...);

int descrypt_open(void ** dataptr, const unsigned char * trackkey, 
                  unsigned int ekbnum, struct himderrinfo * status);
int descrypt_decrypt(void * dataptr, unsigned char * block, size_t cryptlen,
                     const unsigned char * fragkey, struct himderrinfo * status);
void descrypt_close(void * dataptr);