Home | History | Annotate | Download | only in kernel_CryptoAPI

Lines Matching refs:ctypes

13 import ctypes
22 class sockaddr_alg(ctypes.Structure):
35 ('salg_family', ctypes.c_uint16),
36 ('salg_type', ctypes.c_char * 14),
37 ('salg_feat', ctypes.c_uint32),
38 ('salg_mask', ctypes.c_uint32),
39 ('salg_name', ctypes.c_char * 64),
84 Use ctypes to run a digest through one of the available kernel ifalg
94 libc = ctypes.CDLL("libc.so.6", use_errno=True)
96 # If you don't specify the function parameters this way, ctypes may try
98 libc.socket.argtypes = [ ctypes.c_int, ctypes.c_int, ctypes.c_int ]
99 libc.bind.argtypes = [ ctypes.c_int, ctypes.c_void_p, ctypes.c_int ]
100 libc.send.argtypes = [ ctypes.c_int, ctypes.c_void_p, ctypes.c_size_t,
101 ctypes.c_int ]
102 libc.recv.argtypes = [ ctypes.c_int, ctypes.c_void_p, ctypes.c_size_t,
103 ctypes.c_int ]
111 if libc.bind(sock, ctypes.addressof(alg), ctypes.sizeof(alg)) == -1:
120 message = ctypes.create_string_buffer(data, len(data))
121 if libc.send(fd, ctypes.addressof(message), ctypes.sizeof(message), 0) == -1:
125 out = (ctypes.c_uint8 * outlen)()
126 ret = libc.recv(fd, ctypes.addressof(out), ctypes.sizeof(out), 0)
131 h = ctypes.string_at(ctypes.addressof(out), ret)