当我检查/ proc/crypto它显示我:
abhi@ubuntu:/proc$ cat crypto
name : stdrng
driver : krng
module : kernel
priority : 200
refcnt : 1
selftest : passed
type : rng
seedsize : 0
name : md5
driver : md5-generic
module : kernel
priority : 0
refcnt : 1
selftest : passed
type : shash
blocksize : 64
digestsize : 16
Run Code Online (Sandbox Code Playgroud)
我需要在我的一个项目中使用aes256.
有人可以指出我如何将这个算法添加到crypto api或者是否有任何其他方式可以实现这一点(ubuntu 10.4,2.6.32-35).
是否有一个支持(默认情况下)使用cryptoapi for kernel 2.6实现的算法列表?
我正在使用Linux(ubuntu)。
我想阅读一些在头文件中声明的函数的函数定义,例如 stdlib.h
我尝试寻找,stdlib.c但找不到。
谁能告诉我在系统上哪里可以找到相应的代码文件。
如果我太天真,请原谅我。谢谢
我遇到了一些测试代码,它直接在终端上执行时提供不同的输出,当它的输出重定向到文件时:
# include <stdio.h>
# include <stdlib.h>
int main()
{
printf("hello\n");
if(fork() ==0)
{
printf("world\n");
}
}
Run Code Online (Sandbox Code Playgroud)
在终端上输出是:
abhi@ubuntu:~/Desktop/ad/A1/CC$ ./vb
hello
abhi@ubuntu:~/Desktop/ad/A1/CC$ world
Run Code Online (Sandbox Code Playgroud)
(打印世界后光标仍然闪烁,输入后显示正常提示.)
在将输出重定向到文件时:
./vb >v.txt
abhi@ubuntu:~/Desktop/ad/A1/CC$ cat v.txt
hello
hello
world
Run Code Online (Sandbox Code Playgroud)
据我所知,父母不等孩子就打印hello并返回.然后孩子应该打印world,代码应该终止.
我无法理解的是,为什么代码在重定向输出时表现不同.这是什么原因?
我有一个非常大的没有说'x'(10 ^ 18)和数字'z'说6.我试图知道/计算使用ac代码,在1到x(10 ^ 18)范围内有多少数字是可被z整除.因为我正在使用一个简单的循环
While(x)
{
if(x % z == 0)
{
count++;
}
--x;
}
Run Code Online (Sandbox Code Playgroud)
但是这个代码花费了太多时间,因为它检查从1到x的所有值.是否有任何已知的算法或技术,我可以优化上述代码,仍然得到相同的结果.非常感谢您的帮助.
我有一个小代码,它在堆上分配一些内存,然后在它使用后尝试释放它.我在内存映射中遇到此错误.
守则是::
void merge(int *arr, int start, int mid, int end)
{
int i = 0, j = 0, k = 0, tmp1 = 0, siz = 0;
int *pt = NULL;
j = start, k = mid+1, tmp1 = start;
siz = (end - start) + 1;
if ((pt = malloc(siz * sizeof(int))) == NULL) /* line 32 */
{
printf("\n ERROR Aloocating mem \n");
return;
}
while (j <= mid && k <= end)
{
if (arr[j] <= …Run Code Online (Sandbox Code Playgroud) linux ×5
c ×4
glibc ×2
aes ×1
algorithm ×1
cryptography ×1
fork ×1
free ×1
gcc ×1
header-files ×1
kernel ×1
ld ×1
libc ×1
linker ×1
optimization ×1